<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zac Anger</title>
    <description>The latest articles on DEV Community by Zac Anger (@zacanger).</description>
    <link>https://dev.to/zacanger</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2279%2FpW-aSVWd.jpg</url>
      <title>DEV Community: Zac Anger</title>
      <link>https://dev.to/zacanger</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zacanger"/>
    <language>en</language>
    <item>
      <title>So You Want To Learn Vim?</title>
      <dc:creator>Zac Anger</dc:creator>
      <pubDate>Sun, 08 Oct 2017 15:28:11 +0000</pubDate>
      <link>https://dev.to/zacanger/so-you-want-to-learn-vim-b78</link>
      <guid>https://dev.to/zacanger/so-you-want-to-learn-vim-b78</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="http://blog.zacanger.com"&gt;my blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Read This?
&lt;/h2&gt;

&lt;p&gt;Why am I qualified to talk about this? There are &lt;em&gt;so many&lt;/em&gt; Intro To Vim posts/articles/whatever out there, so why should you read this one?&lt;/p&gt;

&lt;p&gt;This isn't going to be a Vim tutorial. It's more of a guide to guides and a short overview of resources.&lt;/p&gt;

&lt;p&gt;I've been using Vim full-time for around two years now, and used a lot of other editors before Vim. It took me a while to figure out what I wanted in an editor, and when I did figure it out it turned out Vim was what I needed. I'm not a Vim expert, but I'm solid enough with it that I can be much more productive in Vim than in any other editor. I'm writing this post in Vim because it's far more comfortable for me now than some other thing with buttons and menus and pointing and clicking and all that. Vim fits really nicely into the environment and workflow I already had (entirely terminal-based).&lt;/p&gt;

&lt;h2&gt;
  
  
  Do You Really Want To Learn Vim?
&lt;/h2&gt;

&lt;p&gt;Are you sure? Why do you want to learn Vim? Is it because someone told you your editor isn't a &lt;em&gt;real&lt;/em&gt; editor and &lt;em&gt;real&lt;/em&gt; programmers use Vim (or Emacs)? That's bullshit. Real programmers use whatever tools help them be productive. If you're already good with your editor, and it suits your needs, stick with it. You should learn Vim if you're not happy with what you're using now. It doesn't matter if you use Atom or Emacs or Eclipse or whatever. If you know your editor well and can get stuff done in it, don't switch editors just because someone said you should. Learn Vim if you're tired of how resource-heavy Atom is, or you spend a lot of time sshed into servers, or you just haven't found something that felt &lt;em&gt;right&lt;/em&gt; yet.&lt;/p&gt;

&lt;p&gt;That being said, I love Vim, and if you want to learn it, and have the time to get moving with it, I think you should. I've used loads of editors in the past (Nano, Notepad++, Kilo/OpenEmacs, Hipper, Atom, LightTable, WebStorm, Visual Studio, VS Code, TextAdept, Sublime Text, and probably others). They all have their good parts and their bad parts. So does Vim, but for me the good far outweighs the bad with Vim (and most of the bad is Vimscript, which is kind of really rough).&lt;/p&gt;

&lt;h2&gt;
  
  
  Where You Should Start
&lt;/h2&gt;

&lt;p&gt;There are &lt;em&gt;loads&lt;/em&gt; of resources for learning Vim out there. A lot of them take the form of games and such. Ignore all those. They'll only teach you the basics, usually just of navigation and maybe two modes. They won't help you &lt;em&gt;understand&lt;/em&gt; Vim, they'll just teach you enough to be able to open it, enter text, move around, and quit. If that's all you need in an editor, switch to Notepad or Nano. Learning how to move and enter text is important, but it's also important to know why things are the way they are in Vim.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vimtutor
&lt;/h2&gt;

&lt;p&gt;Start with &lt;code&gt;vimtutor&lt;/code&gt;. If you're on Linux, BSD, or Mac, you probably already have it installed. Just type &lt;code&gt;vimtutor&lt;/code&gt; in a terminal, and do the whole thing.  You don't have to do it all at once, and you don't have to do it &lt;em&gt;only&lt;/em&gt; once. I think I've gone through it two or three times, and the first time took me three days, doing just a bit at a time.&lt;/p&gt;

&lt;p&gt;If you're on Windows, you'll need to install Vim manually, and then you should have Vim available under &lt;code&gt;%ProgramFiles%\vim\vim[version]\vimtutor.bat&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading
&lt;/h2&gt;

&lt;p&gt;Then read &lt;a href="https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118"&gt;this&lt;/a&gt;.  It explains a lot about how to &lt;em&gt;think&lt;/em&gt; about using Vim.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.moolenaar.net/habits.html"&gt;This bit&lt;/a&gt;, from the guy who wrote Vim originally, is also worth a read.&lt;/p&gt;

&lt;p&gt;Then go &lt;a href="https://github.com/mhinz/vim-galore"&gt;read this&lt;/a&gt;. There's a &lt;em&gt;lot&lt;/em&gt; of information there. You don't need to remember it all, but it's a handy reference.&lt;/p&gt;

&lt;p&gt;If you get stuck at any point, use the built-in help (with &lt;code&gt;:h thing&lt;/code&gt;, like &lt;code&gt;:h reg&lt;/code&gt;). The help in Vim is &lt;em&gt;great&lt;/em&gt;, probably better than any other editor's. You should get in the habit of checking the help before Googling something, because the help is probably more accurate, and is also closer at hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Vim?
&lt;/h2&gt;

&lt;p&gt;Most OSs will come with some version of Vim already installed (the exception being Windows). Chances are it's a stripped-down and/or old version, though. I use and highly recommend &lt;a href="https://github.com/neovim/neovim/"&gt;Neovim&lt;/a&gt;, but if that's not available or up to date for your system, make sure you're on Vim 8.  Vim 7.x is pretty old, and missing a lot of the nice things that are in Neovim and now in Vim 8.&lt;/p&gt;

&lt;p&gt;There are graphical versions of Vim — Gvim, MacVim, GUI wrappers for Neovim, etc. You can use those if you want, there's nothing wrong with them. I don't see the point in them personally, because they don't add anything except some menus and buttons which all do things you can just do in Vim or in the shell anyway, but some people really like them. Use the thing that makes you comfortable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Editors
&lt;/h2&gt;

&lt;p&gt;You can also get started in some other editor. Every good editor has a Vim plugin, and I actually recommend starting this way if you're not comfortable switching all at once. I used Vim plugins in LightTable, Atom, and TextAdept for a few months before actually making the switch, and it made things a bit easier.  You will hit limits with those plugins, though: most of them don't have any &lt;code&gt;ex&lt;/code&gt; command support (all the things that start with &lt;code&gt;:&lt;/code&gt;), and some of them (like VS Code's) are &lt;em&gt;really&lt;/em&gt; basic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;It's really easy to get lost in configuration, for any editor (or any tool, I guess). Vim is just as bad as the rest. Some people, myself included, spend way too much time tweaking their configs. I don't recommend starting with someone else's configs, though. They'll have opinions that don't align with yours, and their &lt;code&gt;.vimrc&lt;/code&gt; will be built for how &lt;em&gt;they&lt;/em&gt; do things not how &lt;em&gt;you&lt;/em&gt; do. I &lt;em&gt;do&lt;/em&gt; recommend cruising GitHub and looking at people's dotfiles for ideas, but don't go with some preconfigured setup that you don't understand.&lt;/p&gt;

&lt;p&gt;I use this &lt;a href="https://github.com/zacanger/z/blob/master/.vimrc"&gt;very minimal vimrc&lt;/a&gt; sometimes, when I need to, and here's my (kinda messy) &lt;a href="https://github.com/zacanger/z/blob/master/.config/nvim/init.vim"&gt;init.vim&lt;/a&gt; for Neovim.&lt;/p&gt;

&lt;p&gt;You will need a plugin manager, eventually. I use NeoBundle, which I think is Neovim-specific. I hear really good things about Vundle for Vim. Pathogen and Dein are also out there, but I haven't tried either of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Stuff
&lt;/h2&gt;

&lt;p&gt;You might end up on systems that don't have Vim (like in containers). They will probably have &lt;code&gt;vi&lt;/code&gt;, though. A lot of the stuff you're used to doing in Vim might not work in vi, but some of it will. You should read up a little bit on &lt;a href="http://wiki.c2.com/?ViEditor"&gt;vi&lt;/a&gt; just in case. Also read the bit on how to pronounce it, because people will be confused if you say &lt;code&gt;veye&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Read &lt;a href="https://sanctum.geek.nz/arabesque/vim-koans"&gt;this post&lt;/a&gt; (and everything else on that blog). Seriously. Even to an intermediate user, there's a lot of good stuff to be learned.&lt;/p&gt;

&lt;p&gt;Don't get discouraged. It took me a few weeks to get fully comfortable using a Vim plugin in other editors, and then another few weeks after I switched full-time to Vim before I felt like I was productive again. It's like learning any other big new thing (a language, framework, paradigm, whatever): it takes time. For me (and for all Vim users, I assume), that time investment has definitely been worth it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuing Education
&lt;/h2&gt;

&lt;p&gt;I make an effort to learn and practice one new thing a day (not Vim-specific; a piece of Clojure's stdlib, Bash trick, whatever). Once you're comfortable using Vim, I recommend doing the same. For example, take a few minutes to check out what you can do with &lt;code&gt;c&lt;/code&gt; and try to use &lt;code&gt;c&lt;/code&gt; more than usual for a few days, until you reach for it naturally when it makes sense.&lt;/p&gt;

&lt;p&gt;There are Vim Golf sites (and a StackExchange thing, I think). These are fun ways to learn more efficient ways to get stuff done in Vim.&lt;/p&gt;

&lt;p&gt;Don't feel pressured to use more advanced features right away. Neat things like macros, advanced register usage, and fancy regex stuff are all very useful, but you don't need to know and use everything all at once. When you find yourself doing something repetitive or annoying, that's a good time to find a better way to do it.&lt;/p&gt;

</description>
      <category>vim</category>
    </item>
    <item>
      <title>What is Set?</title>
      <dc:creator>Zac Anger</dc:creator>
      <pubDate>Sat, 23 Sep 2017 18:46:44 +0000</pubDate>
      <link>https://dev.to/zacanger/what-is-set</link>
      <guid>https://dev.to/zacanger/what-is-set</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="http://blog.zacanger.com"&gt;my blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Someone recently asked in a Slack channel how they might clean up the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;getNames&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;contacts_set&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

  &lt;span class="nx"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;firstName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contactInfo.firstName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contact&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contactInfo.lastName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fullName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contacts_set&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;contacts_set&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contactsSet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;contactsSet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Note that the &lt;code&gt;get&lt;/code&gt; and &lt;code&gt;set&lt;/code&gt; going on here seemed to be Ember-specific, or a &lt;code&gt;_.get&lt;/code&gt; type of thing. I don't know Ember, so I'm not positive.)&lt;/p&gt;

&lt;p&gt;And I said, how about this?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;getNames&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;contacts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="na"&gt;contactInfo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;lastName&lt;/span&gt; &lt;span class="p"&gt;}})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I like this version because it's concise, readable (to me, at least?), mutation-free, and declarative.&lt;/p&gt;

&lt;p&gt;And then someone else asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can some one eli5 what &lt;code&gt;Set&lt;/code&gt; is that's referenced above?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which made me realise that a lot of folks still aren't using a lot of the nice new things from ES2015, so I explained a bit. Here's how I understand it.&lt;/p&gt;

&lt;p&gt;Set is a new (in ES2015) iterable builtin (like Array, String, TypedArray). Map is also new in 2015. Set is to Array as Map is to Object, kinda.&lt;/p&gt;

&lt;p&gt;For practical usage Set is basically Array but unique, and with different methods. &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;has&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt;, and some others. There's a lot more info &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set"&gt;on MDN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can pass &lt;code&gt;Set&lt;/code&gt; an iterable, which is why the thing I have above works (because the &lt;code&gt;contacts.map...&lt;/code&gt; thing inside &lt;code&gt;new Set()&lt;/code&gt; results in an array).&lt;/p&gt;

&lt;p&gt;In that case &lt;code&gt;Set&lt;/code&gt; isn't being used for too much besides just the fact that it's &lt;code&gt;Set&lt;/code&gt; (so it only holds unique values). Someone else pointed out in the same channel that maybe it's not the best idea if you have a very large collection, because then you're creating a whole extra collection in the process, which is totally true.&lt;/p&gt;

&lt;p&gt;There's a bit more background &lt;a href="https://en.wikipedia.org/wiki/Set_(mathematics)"&gt;here&lt;/a&gt; on what JS's &lt;code&gt;Set&lt;/code&gt; is supposed to be kind of like.&lt;/p&gt;

&lt;p&gt;And underneath it sorta looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;has&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;remove&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;splice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a lot of stuff, but mostly you can think of &lt;code&gt;Set&lt;/code&gt; as a thing that's like &lt;code&gt;Array&lt;/code&gt; but it only holds unique things.&lt;/p&gt;

&lt;p&gt;There's also a &lt;code&gt;WeakSet&lt;/code&gt; which can only hold objects. I haven't really found a valid use case for &lt;code&gt;WeakSet&lt;/code&gt; and &lt;code&gt;WeakMap&lt;/code&gt; yet, personally.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Set&lt;/code&gt; turns out to be pretty useful. Definitely play around with it!&lt;/p&gt;

</description>
      <category>set</category>
      <category>javascript</category>
      <category>es2015</category>
    </item>
    <item>
      <title>Hi, I'm Zac Anger</title>
      <dc:creator>Zac Anger</dc:creator>
      <pubDate>Wed, 22 Feb 2017 16:34:40 +0000</pubDate>
      <link>https://dev.to/zacanger/hi-im-zac-anger</link>
      <guid>https://dev.to/zacanger/hi-im-zac-anger</guid>
      <description>&lt;p&gt;I have been coding for 8 years.&lt;/p&gt;

&lt;p&gt;You can find me on Twitter as &lt;a href="https://twitter.com/zacanger" rel="noopener noreferrer"&gt;@zacanger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in SLC.&lt;/p&gt;

&lt;p&gt;I work for Jane.com&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: JS, Bash.&lt;/p&gt;

&lt;p&gt;I am currently learning more about Clojure(Script), Haskell.&lt;/p&gt;

&lt;p&gt;Nice to meet you.&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
