<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mariela C on Medium]]></title>
        <description><![CDATA[Stories by Mariela C on Medium]]></description>
        <link>https://medium.com/@marielaMantle?source=rss-613e2c94c11b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VtM-5Y25J_Xz9aR7BhoQqQ.jpeg</url>
            <title>Stories by Mariela C on Medium</title>
            <link>https://medium.com/@marielaMantle?source=rss-613e2c94c11b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:25:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marielaMantle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is a Set  in javascript?]]></title>
            <link>https://medium.com/@marielaMantle/what-is-a-set-in-javascript-6ead570600e?source=rss-613e2c94c11b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ead570600e</guid>
            <category><![CDATA[set]]></category>
            <category><![CDATA[storyteller]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[storytelling]]></category>
            <dc:creator><![CDATA[Mariela C]]></dc:creator>
            <pubDate>Wed, 27 Apr 2022 05:25:39 GMT</pubDate>
            <atom:updated>2022-04-27T16:40:32.778Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoDabFfR0DHroWPe4oWQ7g.jpeg" /></figure><p>The set object lets you store a collection of unique values of any type.</p><p>Types can be basic primitives like strings and integers and range to fancier object types like arrays or object literals.</p><p>Let’s check out some ways we can create a set and modify it.</p><p>📖 I just remembered 🤔 I need to go shopping for a night out in town 🌃.</p><blockquote><em>To create a set:<br></em>let shoppingBag = new Set();<br>Note: You can also provide an object type <br>let shoppingBag = new Set([“👠” ,“👜”, “👗”,“👗”,“👗”, “💄”])</blockquote><p>🧾 console.log(shoppingBag) //{“👠” , “👜”, “👗”, “💄”}</p><p>📖 After a fun day at the mall I realized I bought way too many shoes and I am kind of on a budget.</p><p>📖 cool 😎 thing about sets is that although I bought 3 pairs of dresses it only captures unique values. So 3 for the price of 1? Who doesn’t like a deal</p><blockquote>I can quickly check the <strong>size</strong> of my set with the size property. It returns number of unique elements in an array.<br>let unique = shoppingBag.size</blockquote><p>🧾 console.log(unique) //4</p><p>📖 🤦🏽‍♀️ I just remembered I need to accessorize with some jewelry.</p><blockquote>The <strong>add()</strong> method adds a new element to the set.<br>shoppingBag.add(‘💍’);</blockquote><p>🧾 console.log(shoppingBag) //{“👠” , “👜”, “👗”, “💄”, “💍”}</p><p>📖 I can’t seem to remember if I bought my favorite lipstick and its getting late.</p><blockquote>The <strong>has() </strong>method checks if the value exists or not<br>shoppingBag.has(“💄”)</blockquote><p>🧾 console.log(shoppingBag.has(“💄”)) //true</p><p>📖 Ok great that’s a relief 😮‍💨!</p><p>📖 So it turns out I went a little over my budget and something has to go back. I have to get rid of the most expensive thing in my shopping bag 🛍️.</p><blockquote>The <strong>delete() </strong>method removes what you tell it to!<br>🪄shoppingBag.delete(“💍”)</blockquote><p>🧾 console.log(shoppingBag) //{“👠” , “👜”, “👗”, “💄”}</p><p>📖 You guessed it 🥹 the 💍.<br>Who doesn’t love a little shop 🛍️🛍️🛍️🛍️🛍️🛍️🛍️🛍️ therapy!<br>Remember that night 🌃 out in town I told you about?<br>I should have checked the weather.<br>Torrential rain ⛈️, I should have seen that coming.</p><p>📖 So I decided to take everything back 😳 since I should not have been shopping to begin with.</p><blockquote>The <strong>clear()</strong> method removes all elements<br>shoppingBag.clear()</blockquote><p>🧾 console.log(shoppingBag) //{}</p><p>📖 Thank you for shopping with me and running around the 🏬 shops. Until next time.</p><p>Useful documentation links:</p><p><a href="https://www.w3schools.com/js/js_object_sets.asp">Resource1</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set">Resource 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ead570600e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>