<?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: Rachel Ralston</title>
    <description>The latest articles on DEV Community by Rachel Ralston (@rachelralston).</description>
    <link>https://dev.to/rachelralston</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%2F2652%2F4aNzhKA0.jpg</url>
      <title>DEV Community: Rachel Ralston</title>
      <link>https://dev.to/rachelralston</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rachelralston"/>
    <language>en</language>
    <item>
      <title>A Meandering Path to Web Development</title>
      <dc:creator>Rachel Ralston</dc:creator>
      <pubDate>Mon, 13 Feb 2017 05:09:22 +0000</pubDate>
      <link>https://dev.to/rachelralston/a-meandering-path-to-web-development</link>
      <guid>https://dev.to/rachelralston/a-meandering-path-to-web-development</guid>
      <description>&lt;p&gt;&lt;em&gt;Ultimately, none of us knows what we’re doing. We all have a sense that we’re imposters in some part of our lives. We’re all guessing and doing whatever we can to stay engaged and grow. It’s ok to follow the turning path of your life and find fulfillment as you create it. This is my meandering path into being a professional full stack developer.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F266%2F1%2AoawDitDyuehrIyLw3Aa96w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F266%2F1%2AoawDitDyuehrIyLw3Aa96w.jpeg"&gt;&lt;/a&gt;#OregonTrailForever ðŸ´&lt;/p&gt;

&lt;p&gt;As far as my child self was concerned, computers were weird boxes that gave me fun games. One fateful day in 5th grade I heard the siren’s song of the &lt;a href="https://www.youtube.com/watch?v=gsNaR6FRuO0" rel="noopener noreferrer"&gt;dial up modem&lt;/a&gt; for the first time and it suddenly clicked for me that I the world wide web could crack open up my tiny world. I was hooked. You couldn’t pry me away from the family computer once I got my hands on a copy of &lt;em&gt;HTML for Dummies&lt;/em&gt; and a bootleg Photoshop. I can still remember after hours of struggling, the &lt;a href="https://admin.mashable.com/wp-content/uploads/2013/07/excited-baby.gif" rel="noopener noreferrer"&gt;pure crystalline joy&lt;/a&gt; the first time I got my browser to display an image that I had made.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F500%2F1%2Amu96DzR-JxFZ8BR0TU5MEQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F500%2F1%2Amu96DzR-JxFZ8BR0TU5MEQ.gif"&gt;&lt;/a&gt;omg omg omg omg itÂ WORKED!&lt;/p&gt;

&lt;p&gt;For a few years I was off and running; I made fan sites, had the god damn coolest myspace page around, and devoured books on the topic. But as middle school turned into high school my passion cooled off and I eventually refocusing my attention on softer skills.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F234%2F1%2AmI-SbtqLie4h2gcFBQDpGg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F234%2F1%2AmI-SbtqLie4h2gcFBQDpGg.jpeg"&gt;&lt;/a&gt;Late 90’s goth was a goodÂ look.&lt;/p&gt;

&lt;p&gt;Looking back, I realize that I did the classic teen girl thing: I subconsciously fell for the cultural messages that girls aren’t good at science and math and the micoraggressions of my peers. While falling behind was in part due to very real learning disabilities, my mindset led me to believe that my minor or coincidental set backs were evidence that I wasn’t &lt;em&gt;able&lt;/em&gt; to succeed. Despite my early love of computer science, by the end of high school I was so turned off by the idea of pursuing the sciences that I went to art school, figuring I’d never have to take a math or science class again.&lt;/p&gt;

&lt;p&gt;Fast forward to college graduation in 2008 and months of unemployment. As it turns out, when the economy is in free fall a BFA in Oil Painting isn’t a particularly useful for gainful employment. I looked at my skills and started developing myself, turning my art training into graphic design skills and brushing up on my decade old hobby of web development.&lt;/p&gt;

&lt;p&gt;Years later still, after wandering through many jobs that ran the gamut from cleaning toilets to customer service, I founded a branding company that helped small and medium sized businesses find their authentic voice and build their web presence. Entrepreneurship was amazing and taught me so much about myself, but it was also exhausting and deeply challenging.&lt;/p&gt;

&lt;p&gt;After that I moved into a Design and Marketing Lead position, which was professionally rewarding but personally not a great fit. I’m thankful for the challenges the position handed me because it helped me realize that while my whole life all I wanted to do was make things, my career had morphed using my skills to convince people to buy things. The exploration of that moment led me to look over my life and think about what would actually make me happy to do, not just what would keep me fed. A few months later I quit that job and made the transition into web development, attending a full time intensive professional apprenticeship program at &lt;a href="https://www.learnersguild.org/" rel="noopener noreferrer"&gt;Learner’s Guild&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ApKWkzvMkbHqdcsvp2R94ZQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ApKWkzvMkbHqdcsvp2R94ZQ.jpeg"&gt;&lt;/a&gt;First day of Learner’s Guild. Don’t they just grow up soÂ fast?&lt;/p&gt;

&lt;p&gt;Getting into engineering has felt like coming home. I get to use my creativity in finding elegant solutions to complicated problems, my entrepreneurial systems thinking to wrap my brain around large projects, my empathy and people skills in working in team and advocating for great user experience.&lt;/p&gt;

&lt;p&gt;The world is a different place now than it was when I was a kid. The song of the dial up connection is literal history, and it now feels strange when the internet isn’t at my fingertips to answer my every passing whim. Looking back over the whole story, I feel sad for my young self that gave up on her technical abilities. I’ve realized now to my surprise that I’m actually pretty good at this. I hope that my work can help to inspire the next generation to trust in themselves and break through barriers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://medium.com/@rachelralston/a-meandering-path-to-web-development-e6fc3389fd6f" rel="noopener noreferrer"&gt;medium.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tech</category>
      <category>webdev</category>
      <category>techculture</category>
      <category>womenintech</category>
    </item>
    <item>
      <title>The ‘this' keyword in Javascript</title>
      <dc:creator>Rachel Ralston</dc:creator>
      <pubDate>Thu, 02 Feb 2017 21:32:53 +0000</pubDate>
      <link>https://dev.to/rachelralston/the-this-keyword-in-javascript</link>
      <guid>https://dev.to/rachelralston/the-this-keyword-in-javascript</guid>
      <description>&lt;p&gt;The keyword &lt;code&gt;this&lt;/code&gt; in Javascript can be a little slippery to wrap your had around at first.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL;DR When you refer to &lt;code&gt;this&lt;/code&gt; in the global context, it refers to the global variable (which is &lt;code&gt;Window&lt;/code&gt; in browsers). When you create a &lt;code&gt;new&lt;/code&gt; object with &lt;code&gt;this&lt;/code&gt; refers to the object's scope.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What Does this Do?
&lt;/h3&gt;

&lt;p&gt;When you call this on the root of a document, it refers to the document's root object, in the case of our browser &lt;code&gt;this&lt;/code&gt; refers to &lt;code&gt;Window&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AkzOiTYdPaV7pWhw5Noiy0Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AkzOiTYdPaV7pWhw5Noiy0Q.png" alt="this keyword"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So if we create a function and add a variable to the global scope then we can call it using &lt;code&gt;this&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2A6LfsfamPpAvst0bC-EI8-Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2A6LfsfamPpAvst0bC-EI8-Q.png" alt="function example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At first &lt;code&gt;hello()&lt;/code&gt; returns undefined because &lt;code&gt;saySomething&lt;/code&gt; is undefined on &lt;code&gt;window&lt;/code&gt;, but once &lt;code&gt;saySomething&lt;/code&gt; is defined we get a proper greeting.&lt;/p&gt;

&lt;p&gt;So what do we do if we want this to refer to something other than the global scope?&lt;/p&gt;

&lt;p&gt;Our first approach is to use &lt;code&gt;call&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt; to specify the scope.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2A0WowWN0ItvawtyVF2dq5ww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2A0WowWN0ItvawtyVF2dq5ww.png" alt="code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  This in Objects
&lt;/h3&gt;

&lt;p&gt;Now let's try this in a different way. Let's see what happens when we use &lt;code&gt;this&lt;/code&gt; in a function that's been set as the property of an object. In this case, &lt;code&gt;this&lt;/code&gt; will refer to the local scope of the &lt;code&gt;adventure&lt;/code&gt; object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AYdOlUzhOgCHzydwzyPX8tg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AYdOlUzhOgCHzydwzyPX8tg.png" alt="code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above case we created the example in an object literal, but what happens when we wrap the example in a constructor function? When we instantiate it with the &lt;code&gt;new&lt;/code&gt; keyword, an empty object is created and &lt;code&gt;this&lt;/code&gt; will refer to that context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AZMbSP6XlHFQiX8yiXeSAGQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AZMbSP6XlHFQiX8yiXeSAGQ.png" alt="code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can instantiate multiple versions of our Adventure class and this will refer to the local scope of each instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AMgD039CPKwYPVLoBneJLDw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AMgD039CPKwYPVLoBneJLDw.png" alt="code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Tricky with 'this'
&lt;/h3&gt;

&lt;p&gt;It's been simple enough to follow the context of ‘this' up to this point, but here's where it can start to get tricky. Take the following example:&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;function&lt;/span&gt; &lt;span class="nf"&gt;Adventure&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Your this is: &lt;/span&gt;&lt;span class="dl"&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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasAdventure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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;waterslide&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;numGoSlide&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="nx"&gt;numGoSlide&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&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;hasAdventure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nf"&gt;celebrate&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="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;celebrate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Your this is: &lt;/span&gt;&lt;span class="dl"&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="k"&gt;if&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;hasAdventure&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Yay, you've been on a soggy and thrilling adventure!&lt;/span&gt;&lt;span class="dl"&gt;"&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;You might assume that we'd get the alert here, but when run we don't get much of anything. The reason is that &lt;code&gt;celebrate()&lt;/code&gt; was defined on the global scope and so its &lt;code&gt;this&lt;/code&gt; refers to the global scope. We can see that when we run this in the console, we're referring to the global scope, global scope doesn't have the attribute &lt;code&gt;hasAdventure&lt;/code&gt;, so we don't get the alert.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AAGB6eFhaoX3wPrcmbx7iSw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AAGB6eFhaoX3wPrcmbx7iSw.png" alt="code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To fix this conundrum, we can pass &lt;code&gt;Adventure&lt;/code&gt;'s local &lt;code&gt;this&lt;/code&gt; into &lt;code&gt;celebrate&lt;/code&gt; and modify &lt;code&gt;celebrate&lt;/code&gt; to take an argument. When we update &lt;code&gt;celebrate&lt;/code&gt; to take an argument you can't use the reserved word &lt;code&gt;this&lt;/code&gt;, so pick another variable to hold that place.&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;function&lt;/span&gt; &lt;span class="nf"&gt;Adventure&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Your this is: &lt;/span&gt;&lt;span class="dl"&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="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasAdventure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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;waterslide&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;numGoSlide&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="nx"&gt;numGoSlide&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&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;hasAdventure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nf"&gt;celebrate&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="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;celebrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;you&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="nx"&gt;you&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasAdventure&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Yay, you've been on a soggy and thrilling adventure!&lt;/span&gt;&lt;span class="dl"&gt;"&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;Now when we call the function we get the alert!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2ARfmCy7eQXtTOCzemfUCotg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2ARfmCy7eQXtTOCzemfUCotg.png" alt="yay"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, this is a powerful tool that helps developers easily refer to properties within specific contexts, but can get tricky when passing through different levels of scope.&lt;/p&gt;

&lt;p&gt;Good Luck &amp;amp; Godspeed.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Trusting Yourself in Solving Algorithms</title>
      <dc:creator>Rachel Ralston</dc:creator>
      <pubDate>Tue, 17 Jan 2017 23:18:42 +0000</pubDate>
      <link>https://dev.to/rachelralston/trusting-yourself-in-solving-algorithms</link>
      <guid>https://dev.to/rachelralston/trusting-yourself-in-solving-algorithms</guid>
      <description>&lt;p&gt;Today’s coding lesson is about trusting yourself.&lt;/p&gt;

&lt;p&gt;I’ve noticed a grumpy-making pattern in myself while I’m coding: I’m given issue X. I understand the problem and I lay out some logic to solve X. I implement my code but inevitably it doesn’t work.&lt;/p&gt;

&lt;p&gt;Ok, cool, I am a zen master as I start to fix, approaching both my thinking and the project from several different angles. I spend 5 hours methodically working my way through this code and ultimately get nowhere. By this time I’m frustrated enough to go ask a technical mentor for help.&lt;/p&gt;

&lt;p&gt;In the span of an hour the problem is solved &lt;em&gt;using the initial logic I came up with in the first place&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2ASNndosJg-HZoJrlX6zKiYg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2ASNndosJg-HZoJrlX6zKiYg.gif"&gt;&lt;/a&gt;such a zenÂ master.&lt;/p&gt;

&lt;p&gt;I’ve spent a lot of time this week thinking about this anti-pattern. Here are the lessons I’m taking from this repeating scenario:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trust yourself. Your thinking is good, you know more than you think.&lt;/li&gt;
&lt;li&gt;Don’t assume an algorithm is wrong just because the code won’t run right away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To improve this area of newly exposed ignorance, I’m going to study turning thought into working code. My process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take an algorithm problem (&lt;a href="https://www.hackerrank.com" rel="noopener noreferrer"&gt;HackerRank&lt;/a&gt; is a favorite) and solve it on paper.&lt;/li&gt;
&lt;li&gt;Write the problem out with edge cases.&lt;/li&gt;
&lt;li&gt;Pseudocode the algorithm out in plain old english.&lt;/li&gt;
&lt;li&gt;Write the actual code. Still on paper.&lt;/li&gt;
&lt;li&gt;Go through line by line and hunt bugs. Hold your problem clearly in your mind and make sure your thinking is going to work.&lt;/li&gt;
&lt;li&gt;Finally, type it into a code editor of your choice &lt;em&gt;as is&lt;/em&gt; and note any mistakes, see if/where it’s broken, correct your mistakes.&lt;/li&gt;
&lt;li&gt;In some comments, decompose the problem. Write about your thinking and what you think of the code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2AehzLd-T4es-aVBk5oV70pg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F320%2F1%2AehzLd-T4es-aVBk5oV70pg.gif"&gt;&lt;/a&gt;both broccoli and learning make me feel likeÂ dancing.&lt;/p&gt;

&lt;p&gt;I’m treating this like math homework, the thing that is a little bit painful that I do every day to hammer some knowledge deep into my psyche. Bonus Points: this also doubles as study for interviews.&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://github.com/rachel-ftw/Interview-prep/tree/master/hackerRank_practice/warmUp" rel="noopener noreferrer"&gt;some examples&lt;/a&gt; of mine which I’ll be adding to over the next couple weeks.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://code.likeagirl.io/trusting-yourself-in-solving-algorithms-9dd697e4069f" rel="noopener noreferrer"&gt;medium.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>womenintech</category>
      <category>tech</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
