<?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 Andy del Valle on Medium]]></title>
        <description><![CDATA[Stories by Andy del Valle on Medium]]></description>
        <link>https://medium.com/@andydelvalle?source=rss-c38f99f59e52------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*R8QHPPr0fupLxuQwNv6b3w.jpeg</url>
            <title>Stories by Andy del Valle on Medium</title>
            <link>https://medium.com/@andydelvalle?source=rss-c38f99f59e52------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:26:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andydelvalle/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[Nurse Turned Software Engineer: How I Changed Careers in Less Than a Year]]></title>
            <link>https://medium.com/codex/nurse-turned-software-engineer-how-i-changed-careers-in-less-than-a-year-528edfd449b9?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/528edfd449b9</guid>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[career-change]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Wed, 24 Mar 2021 04:13:08 GMT</pubDate>
            <atom:updated>2021-04-15T00:57:30.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RB0BsEnsj9lnGUqf" /><figcaption>Photo by <a href="https://unsplash.com/@joshuaearle?utm_source=medium&amp;utm_medium=referral">Joshua Earle</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>“How in the world did I get here?!” - Me, everyday.</blockquote><p>I always envisioned myself becoming a Software Engineer but I didn’t know when that would happen. When 2020 came around, I did what most people do at the start of a new year, I set a goal. I thought to myself:<em> “it’s a new decade, no better time than now!” </em>So I made the scary decision to change careers and jump into the world of tech. Fast forward to today and I’m actually doing it. I’m a Software Engineer!</p><p>In this article, I’ll reflect on my journey on how I left my job as a Registered Nurse in the Intensive Care Unit to become a Software Engineer in a Fortune 500 company.</p><p>I’ll discuss what I did and give helpful tips along the way. I’ll also share what I think I could’ve done better. I’d also like to point out that this was my own personal journey. There are many other successful career changers whose pathways are totally different but equally challenging (or not) than mine.</p><p>For a bulleted summary, scroll down to “TLDR Version” :)</p><h3>Getting ready to make the jump</h3><blockquote>“… the timing felt right.”</blockquote><p>Working as a nurse came with its challenges. I was working overtime with a sporadic schedule and had the night shift from 7 pm to 7 am. It was definitely taking a toll on my physical and mental health. When 2020 came around I felt fired up to do something about it and that’s when I made the decision.</p><p>The talk of COVID-19 spreading was also happening. The <a href="https://www.history.com/this-day-in-history/first-confirmed-case-of-coronavirus-found-in-us-washington-state">first case reported</a> in the United States happened on Jan. 21, 2020, and it was found in my residential state! I live with someone who is immunocompromised and I couldn’t risk the possibility of it reaching my home since I was working in the frontline. So this pushed my decision even further. I’m still shocked at the huge bullet I dodged since I had no clue it would later become a global pandemic.</p><p>I had to set myself up for success. My financial situation was a barrier to entry for me. I’ve only been working as a nurse for 2.5 years and even then I had a considerable amount of debt that my income was going towards. I was already planning to save 3–6 months of monthly expenses and I’ve been working closely with a financial trainer since 2019 to achieve that goal.</p><p>I didn’t quite save the amount I wanted but the timing felt right. So I decided to leverage my resources and got into a little more debt. I purchased a Macbook Pro in January and later applied for a private student loan when I enrolled in a coding bootcamp. The money that I was able to save would go towards monthly expenses while I was unemployed.</p><p>After doing research, I decided to enroll in Flatiron School. I enjoyed their free <a href="https://flatironschool.com/free-courses/coding-bootcamp-prep">Bootcamp prep online</a> and the curriculum was just what I was looking for. I was also looking forward to the career support they offer after graduation. At the time, they had a money-back guarantee if I didn’t find a job within one year. It was the right fit for me.</p><blockquote>👉 TIP: ask your admission counselor if they offer any free grants or scholarships to help bring tuition costs down.</blockquote><p>In March, I officially left my nursing job. The country also just went into lockdown so my choice became a bit unnerving not knowing if I could secure a job afterward. But I already made the decision so I had to stick through it. I spent the entire month prepping for Flatiron’s technical interview for admission. Looking back, the interview seems simple, but at the time I was pretty stressed out about it and fumbled through my solution. I passed and was scheduled to join the April 20, 2020 cohort.</p><h3>Bootcamp and the learning mindset</h3><blockquote>“My biggest takeaway was learning how-to-learn…”</blockquote><p>Flatiron School was a great experience. All my instructors were knowledgeable and my cohort had a great energy to them so it made the experience a fun one. We originally signed up to learn on-campus but since the country was in lockdown, learning was changed to “online until further notice” (we actually never got to experience on-campus, sigh).</p><p>The bootcamp took 15 weeks, Monday to Friday 9 am to 5 pm. It included five modules — three weeks per module, or “mod.” Each mod built upon the previous one and we learned things like programming fundamentals, Ruby on Rails, Javascript, and React. At the end of each mod was a paired or grouped project.</p><p>Projects were my favorite part because I enjoyed building them in a team-setting. I didn’t know it then but I was learning a big part of software development — team building and project management. It was also really fun watching other teams present what they created.</p><p>The last mod was self-directed. We had three weeks to create a solo “passion project” where we implemented the new skills we learned. I created a health-productivity app called <em>Simple Care </em>(you can watch a video demo of it <a href="https://www.youtube.com/watch?v=DI4j9yhgR2U&amp;t=24s">here</a>). I also had the pleasure of collaborating with one of the Flatiron UX designers to help with the look and feel of the app. I was happy with my final project.</p><blockquote>👉 TIP: Use Google and Stack Overflow. ANY problem I had was already addressed there. Just copy and paste any coding errors to Google and you’ll find something. Learn how to find solutions online before asking instructors or other cohort-mates for help. Googling is an important skill to have nowadays.</blockquote><p>I did my best to make sure I got all my assignments and projects done within bootcamp hours. But there were times I spent extra hours into the night or on the weekend just to make sure my projects were up to par.</p><p>Here are a few tools I used in adjunct to Flatiron School resources:</p><ul><li>Google and Stack Overflow for debugging and solutions to errors</li><li>YouTube for guided tutorials</li><li><a href="http://trello.com/">Trello</a> for project management and collaboration</li><li><a href="https://www.screencastify.com/">Screen Castify</a> or Zoom to record video walkthroughs of my projects</li><li><a href="http://notion.so/">Notion</a> for note-taking</li></ul><blockquote>👉 TIP: If I could do one thing differently it would be to practice coding challenges for future technical interviews. We were also required to write five blog posts before we graduated. I probably should’ve used my blog posts to write out solution walk-throughs to coding challenges I did on <a href="https://leetcode.com/">Leetcode</a>. That way I’d practice writing and talking about my thought process on technical questions for later interviews.</blockquote><p>Going through a bootcamp was a tremendous help. My biggest takeaway was learning <em>how-to-learn</em> and building a momentum that propelled me during the job hunt. This momentum gave me the confidence to apply to any job I wanted to and network with as many people as I could.</p><h3>Post-grad: networking, interviews, and more learning</h3><blockquote>“Every connection I made was an opportunity to be grateful.”</blockquote><p>I graduated on July 30, 2020. I was now able to utilize career support and I went straight to work. Career support included access to a career coach, resume review, a mock behavioral interview, a mock technical interview, and access to Flatiron School resources on how to job search and network.</p><blockquote>👉 TIP: For those going the bootcamp route, I would suggest taking only a few days, one week max, to take a small break after graduating. Of course, if you need to, take as long a break as you need. But I believe going straight to work kept my momentum and drive up to land a job.</blockquote><h4><strong>LinkedIn was my best friend</strong>.</h4><p>I spent every day on LinkedIn connecting with strangers who were willing to give me any advice they can give. One thing I wasn’t expecting was how supportive and responsive people were. One person would even send me messages to cheer me on. I believe, if you are approaching people with kindness and authenticity, you’ll be well-received and they’ll be more willing to help. Every connection I made was an opportunity to be grateful since I know peope were taking time out of their day to help a stranger like me. I made sure to say “thank you” with every connection I made.</p><p>I joined any networking event, webinar, and community I could. A few of my favorites were:</p><ul><li><a href="https://www.meetup.com/Junior-Developer-Happy-Hour/"><strong>Junior Developer Happy Hour</strong></a><strong>. </strong>A meet-up that held Ask-Me-Anything events with successful bootcamp grads. You also get access to their Slack channel where people post new job listings and opportunities.</li><li><a href="https://www.linkedin.com/company/1000hires/"><strong>1000Hires</strong></a><strong>.</strong> A project created to give more visibility to people who are looking for a job during the pandemic. You can see my 7-min interview with them <a href="https://www.linkedin.com/feed/update/urn:li:activity:6715299794698424320/">here</a>. You also get access to their Slack channel.</li><li><strong>Flatiron Alumni.</strong> After graduating, you get added to the Flatiron School Alumni Slack channel. I kept in touch with cohort-mates and we gave each other tips and shared helpful opportunities with each other.</li><li><strong>Flatiron’s Employer Partnerships.</strong> Flatiron School also has an Employee Partnerships program where the team emails you job opportunities.</li><li><a href="https://www.linkedin.com/company/wonsulting/"><strong>Wonsulting</strong></a><strong>.</strong> A community turning ‘underdogs into winners.’ They hold live events where professionals come and share their stories and had great tips on how to navigate job-seeking.</li><li><strong>LinkedIn Influencers.</strong> People on LinkedIn who post motivating and helpful content during the job hunt. <a href="https://www.linkedin.com/in/abelcak/">Austin Belcak</a>, <a href="https://www.linkedin.com/in/mariamjameel/">Mariam Jameel</a>, and <a href="https://www.linkedin.com/in/renoperry/">Reno Perry</a> are a few of my favorites.</li></ul><blockquote>👉 TIP: You can start networking WHILE you’re learning or in a bootcamp. Post your progress on LinkedIn or Twitter and let people know what you are up to and what interests you. That way you’ll have a track record on how far you’ve progressed and can show that to recruiters and employers.</blockquote><h4><strong>As for applying to jobs, I used every method suggested to me</strong>.</h4><p>I tried the “machine-gun” or “spray-and-pray” method where I went to job boards and applied to every application posted — some I was totally underqualified for; I got <em>one</em> interview out of this method. I applied to the jobs Employer Partnerships emailed me; I got <em>one</em> interview through this method. I connected with people on LinkedIn who shared some job events; I got <em>one </em>interview this way. A past colleague was able to refer me and I landed <em>one </em>interview at their company. I landed <em>one</em> more interview which I’ll share down below.</p><blockquote>👉 TIP: If I was more confident, I would have attended hackathons. You get to directly work with and learn from other engineers. It’s a great networking event and potential employers can actually see how you work in a team.</blockquote><h4><strong>In between networking and applying to jobs, I made sure to follow the “ABC: Always Be Coding” principle</strong>.</h4><p>I participated in the #100daysofcode challenge where I posted online what I learned regarding coding every single day. I even landed <em>one</em> job interview this way! A past colleague saw how hard I was working and decided to give me an interview. However, I advise to take caution as I was burnt out from being on the computer every day. I had to step away for a week to reset. I also did as many coding challenges as I could to prepare for the dreaded technical interview. If you’d like, <a href="https://medium.com/swlh/solving-an-algorithm-in-a-technical-interview-the-problem-solving-approach-9b71627b03f7">here</a> is an article I wrote on how to approach problems in a technical interview. In addition to all this, I took a couple Udemy courses online to anything I felt was relevant.</p><h3>Now for the exciting part</h3><p>In October, three months after graduating from bootcamp, I received an offer! I was thrilled because I was starting to lose hope. I was burning through my savings and was at the end of my resources. I even called my old job to see if they would be willing to take me back — which they were. That same week I was finishing up onboarding back to my old job, I received a job offer to be a Software Engineer! And at a Fortune 500 company! I was shocked at the timing of it all.</p><p>Here are the numbers:</p><ul><li>Over 120 job applications</li><li>5 first-round interviews</li><li>3 technical interviews</li><li>2 take-home coding challenges</li><li>1 job offer 🎉</li></ul><p>I celebrated by taking a much-needed break away from the computer (and to a nice dinner and drinks of course). The position didn’t start until a month after I got the offer so I decided to use that time to relax and do absolutely nothing. That way I would be re-energized when I started.</p><p>I have a lot of things to be grateful for. Other than landing this job during a time I was beginning to feel hopeless, I was also able to stay safe and healthy throughout this global pandemic. This experience was definitely a roller coaster ride and challenged me mentally and emotionally. I want to make sure I can be a helping hand to others going through this same process by sharing my experience.</p><p>Happy coding 😄</p><h3>TLDR version</h3><h4>Timeline</h4><ul><li><strong>Pre-Jan</strong>: started working on my 3–6 month savings, in case I was serious about changing careers.</li><li><strong>Jan:</strong> committed to changing careers and invested in a new Macbook Pro.</li><li><strong>Mar:</strong> officially quit my job and prepared for coding bootcamp.</li><li><strong>April: </strong>started the 15–week bootcamp, spent Mon-Fri coding all day, sometimes into the night and on weekends.</li><li><strong>July: </strong>graduated and officially on the job hunt. I utilized Flatiron’s career support, networking on LinkedIn, and joined any event or community I could.</li><li><strong>Aug-Oct</strong>: Interviews, coding challenges, more networking, and applying to jobs</li><li><strong>Oct:</strong> Landed a job offer! Took a much-needed month long break.</li><li><strong>Nov:</strong> Started working as a Software Engineer</li></ul><h4>Key takeaways</h4><ul><li>Leverage your resources</li><li>Work hard, network, and always be learning</li><li>Practice gratitude and believe in yourself :)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=528edfd449b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/nurse-turned-software-engineer-how-i-changed-careers-in-less-than-a-year-528edfd449b9">Nurse Turned Software Engineer: How I Changed Careers in Less Than a Year</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeScript: what is it and how does it relate to JavaScript?]]></title>
            <link>https://levelup.gitconnected.com/typescript-what-is-it-and-how-does-it-relate-to-javascript-8ff2cdd525d6?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ff2cdd525d6</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Thu, 22 Oct 2020 23:37:59 GMT</pubDate>
            <atom:updated>2020-10-22T23:37:59.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ETnWW7q_vMUoWV43" /><figcaption>Photo by <a href="https://unsplash.com/@wezlar11?utm_source=medium&amp;utm_medium=referral">Dean Pugh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’re interested in Front End Development, you’ll have to learn the three fundamental languages to creating a website: HTML, CSS, and JavaScript. <em>TypeScript</em>, however, has been growing in popularity since it’s release in 2012 and has been considered a promising language to be adopted by many front end developments. In fact, <a href="https://www.zeolearn.com/magazine/typescript-will-be-official-language-at-google">Google has adopted TypeScript</a> as one of its official languages they use. So, learning TypeScript can be very beneficial to any developer who wants to become a Front End Developer.</p><h4>What is TypeScript?</h4><p>TypeScript (TS) is a superset to JavaScript (JS), meaning it can do all the things that JS can do with some added features. Its main feature is to add <em>static typing</em> to the dynamic language of JS.</p><p>A few benefits of TypeScript:</p><ul><li>Provides a way to describe the shape of an object</li><li>Allows you to validate that your code is working correctly.</li><li>Decreases the amount of debugging you’ll have to do</li></ul><h4>Compare JavaScript with TypeScript</h4><pre>// JavaScript<br>let person = &quot;Andy&quot;<br>console.log(`My name is ${person}.`)</pre><pre>// TypeScript<br>let person = &quot;Andy&quot;<br>console.log(`My name is ${person}.`)</pre><p>Wait, where’s the difference? The difference here is very subtle but that’s because TS’s goal is to <em>extend</em> JS, so the above code will work for both. When you’re declaring a variable in JS, you don’t have to explicitly say what type it will be. In TS, however, the initial declaration of a variable will be <em>implicitly</em> typed to be the type of the value it was assigned. So the variable person in the TS example will be <em>typed</em> as a <em>String</em> because it values is a String. This is known as <em>inference, </em>TS infers that person is a string.</p><h4>Explicit and static typing</h4><p>To better illustrate the power of TS, you can <em>explicitly</em> write the type you want the variable to be. Rewriting the above example, we would get:</p><pre>// JavaScript<br>let person = &quot;Andy&quot;<br>console.log(`My name is ${person}.`)</pre><pre>// TypeScript<br>let person: string = &quot;Andy&quot;;<br>console.log(`My name is ${person}.`);</pre><p>Notice in the TS example above that we explicitly wrote that person is to be a string by adding a colon. This will tell the compiler that the name variable is to <em>only</em> be of the String type.</p><pre>// Before in JavaScript<br>let name = &quot;Andy&quot;<br>// Also OK<br>person = 1;<br>person = true;<br>person = {name: &quot;Andy&quot;}</pre><pre>// TypeScript<br>let person: string = &quot;Andy&quot;;<br>// Not OK, errors will occur<br>person = 1;<br>person = true;<br>person = {name: &quot;Andy&quot;}</pre><p>The above example shows the power of static typing with TS. Before, In JS, you could change the type of a variable by simply assigning it to anything you’d like. Now, with TS, the declared variable will only accept a value that is the type it was initially declared with. This will allow your code to be more reliable and to evade errors during compile time.</p><h4>TS as a linter?</h4><p>If you’re familiar with linting, you could argue TS to be some sort of a JS linter. When TS is installed, there is an automated checking of your code for programmatic errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sc5aWkk2VHcrfy1cZU62Jg.png" /><figcaption>TS file with errors</figcaption></figure><p>In this example, notice that our code editor is telling us there are errors made in lines 4–6. This is because this is a TS file. If you hover over each error you will receive an error stating the value you assigned is not assignable. Here is the error when you hover over the error in line 4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyKrKmOnks0teTiT0bAytA.png" /></figure><p>This is the main feature TS has to offer; it takes JS and adds static typing to it. This will allow you to have more control over how you want to shape your objects so that you don’t run into bugs after compiling.</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ff2cdd525d6" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/typescript-what-is-it-and-how-does-it-relate-to-javascript-8ff2cdd525d6">TypeScript: what is it and how does it relate to JavaScript?</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Methods you didn’t know you could use on the console object]]></title>
            <link>https://levelup.gitconnected.com/methods-you-didnt-know-you-could-use-on-the-console-object-ecb6e1f4d941?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecb6e1f4d941</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Fri, 09 Oct 2020 23:44:49 GMT</pubDate>
            <atom:updated>2020-10-13T14:12:19.882Z</atom:updated>
            <content:encoded><![CDATA[<h3>Methods You Didn’t Know You Could Use on the Console Object</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Lt1U_kONdJ1ewnl" /><figcaption>Photo by <a href="https://unsplash.com/@kellysikkema?utm_source=medium&amp;utm_medium=referral">Kelly Sikkema</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>A brief intro to the console</h3><p>The console can be a developer&#39;s most trusted tool. Developers know that using the console can help them debug their code. It throws error messages when your code isn’t compiled correctly and can print whatever you explicitly tell it to by using the console object.</p><p>From the official MDN web docs:</p><blockquote>The console object provides access to the browser’s debugging console. … The console object can be accessed from any global object. … It’s exposed as Window.console, and can be referenced as simply console. For example:</blockquote><pre>console.log(&quot;Hello World&quot;)</pre><p>The above example uses the console object to print the string Hello World to the debugging console. We were able to access the debugging console by using the console object and used the built-in method.log()to print whatever we’d like to the console — in this case, the string “Hello World”.</p><h3>Methods</h3><p>console.log() is a popular debugging tool used by developers. However, since console is simply an object, and.log()is a method used on that object, there are probably a few other methods that can be used on it.</p><p>According to the official Mozilla documentation (MDN web docs), there are <em>twenty-three </em>methods that can be used on console . Yes, you read that right — twenty-three! Some methods are used in conjunction but still, I had no idea there were <em>that</em> many.</p><p>Below are a few methods that I liked and found interesting. If you’d like to see all 23 of them, visit MDN web docs <a href="https://developer.mozilla.org/en-US/docs/Web/API/console">here</a>.</p><h4>1. console.log</h4><p>Okay, we covered this one already. But I wanted to go over a few things you could do with it.</p><ul><li><strong>Print more than just one item</strong>. You can print multiple items with the same or different data types in one line. Just separate the items with a comma in between each.</li></ul><pre>console.log(&quot;Hello&quot;, 1, true, null)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*4QyKsqWSN2P0LlXeh2MtXQ.png" /><figcaption>Multiple data types printed in the same line</figcaption></figure><ul><li><strong>Use interpolation to print variables</strong>. You can wrap the string to be printed with backticks (`) and use ${} to print whatever variable you want. This one is especially handy when you’re trying to debug and are not sure what the value of a variable is.</li></ul><pre>const name = &quot;Andy&quot;;</pre><pre>console.log(`Hello, ${name}!`);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*8kXYCAQ0JS4ljGz3-PJvWw.png" /><figcaption>A printed string using interpolation</figcaption></figure><ul><li><strong>Use a format specifier </strong><strong>%c to style your text with CSS</strong>. This is a fun console trick that most people don’t know about. In this case, console.log() will take in two parameters. The first one is what’s printed to the console and the second is the style you want to apply using CSS. Anything after the %c will be styled. For a list of properties that can be used with the %c syntax, check out the MDN web docs <a href="https://developer.mozilla.org/en-US/docs/Web/API/console">here</a>.</li></ul><pre>console.log(</pre><pre>&quot;I am some %cstyled text&quot;,</pre><pre>&quot;background: white; color:black; font-style:italic&quot;</pre><pre>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*8fNtOACxXUG3NGGYOhVBbw.png" /><figcaption>A string with CSS applied</figcaption></figure><h4>2. console.warn &amp; console.error</h4><p>The next two methods .warn and .error act similarly to .log. They are all used to output text and other data to the console. However, each of these results in output styled differently in the log.</p><pre>console.warn(&quot;I am a warning.&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*VwsjQEOroM2mJS3Td7orjg.png" /><figcaption>A warning message using console.warn</figcaption></figure><pre>console.error(&quot;ERROR! Something went wrong.&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*EIIURTze5kT54KY1pHGDNQ.png" /><figcaption>An error message using console.error</figcaption></figure><h4>3. console.dir</h4><p>This one is especially helpful if you want to view the properties of a DOM element. Say we had a paragraph element (p)that we would like to view. We can querySelector the document for a paragraph element and assign it to a variable. Then we can pass that variable to console.dir and view all the properties associated with that paragraph (i.e. the innerText).</p><pre>const p = document.querySelector(&quot;p&quot;);</pre><pre>console.dir(p);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*UwnK9ijUqJp0m2Xo48RbYA.png" /><figcaption>Collapsed list of properties linked to p</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*eyx0Xi7q7Gf8cvtt8QphuA.png" /><figcaption>Long opened list of properties linked to p</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*l7GTKsnUiobcxV4WCVfZ4A.png" /><figcaption>Value of the innerText associated with p</figcaption></figure><h4>4. console.group &amp; console.groupEnd</h4><p>Grouping together data can be especially helpful when you want to print the properties of an array. According to MDN web docs, you can create a group to help organize your output by visually combing related material. To create a group, or block, call console.group(). To exit the group, simply call console.groupEnd(). For example:</p><pre>const people = [<br>    { name: &quot;John&quot;, age: 29 }, <br>    { name: &quot;Jane&quot;, age: 33 }<br>];</pre><pre>people.forEach((person) =&gt; {<br>    console.group(`${person.name}`);<br>    console.log(`This is ${person.name}`);<br>    console.log(`${person.name} is ${person.age} years old`);<br>    console.groupEnd(`${person.name}`)<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*2Gukr7YihkC_67xVJ1Or9w.png" /><figcaption>The organized output of people grouped by name</figcaption></figure><h4>5. console.time &amp; console.timeEnd</h4><p>These methods can be used to time how long it takes the browser to perform a task (i.e. requesting data). Each method takes in a name that connects the two. Used together, it will log the elapsed time in seconds since it started. Below is an example from <a href="https://github.com/wesbos">Wes Bos</a>, a developer instructor who has courses such as #JavaScript30. The name “fetching data” is used to connect the two methods where console.time starts the timer and console.timeEnd stops it.</p><blockquote>Fun fact: up to 10,000 simultaneous timers can run on a given page.</blockquote><pre>console.time(&quot;fetching data&quot;);<br>fetch(&quot;https://api.github.com/users/wesbos&quot;)<br>    .then((res) =&gt; res.json())<br>    .then((data) =&gt; {<br>        console.timeEnd(&quot;fetching data&quot;);<br>        console.log(data);<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*XNA8Q6RwSa7bpI0KCiXxpQ.png" /><figcaption>Printed out the elapsed time (18.73095703125ms) to fetch data</figcaption></figure><h4>6. console.table</h4><p>The table method displays tabular data as a table. Take the example where we grouped together with the output of people by names. We can see the entire data of that array and view them in a table format</p><pre>const people = [<br>    { name: &quot;John&quot;, age: 29 }, <br>    { name: &quot;Jane&quot;, age: 33 }<br>];</pre><pre>console.table(people);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cA4bI3YmTHXxPYvcwGmk-g.png" /><figcaption>The people array printed in table format</figcaption></figure><p>Those are just a few of the many methods you can use on the console object. Were you surprised by any of these? If you’re interested in learning more cool methods I recommend you check out the Mozilla documents and play around with the ones that you find interesting.</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecb6e1f4d941" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/methods-you-didnt-know-you-could-use-on-the-console-object-ecb6e1f4d941">Methods you didn’t know you could use on the console object</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving an Algorithm in a Technical Interview: The Problem-Solving Approach]]></title>
            <link>https://medium.com/swlh/solving-an-algorithm-in-a-technical-interview-the-problem-solving-approach-9b71627b03f7?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b71627b03f7</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 20:42:13 GMT</pubDate>
            <atom:updated>2020-09-30T13:34:59.689Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4aJx5SEA1hgK_QqL" /><figcaption>Photo by <a href="https://unsplash.com/@austindistel?utm_source=medium&amp;utm_medium=referral">Austin Distel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Technical interviews can be conducted in many ways. Some companies will send you a coding assessment to complete at home. Others will have a pair programming session with you to build an app using the languages and frameworks you claim to know on your resume. Most of the time, however, you will be expected to solve an algorithm.</p><p>Interviewers choose algorithms because it is a great way for them to get an understanding of <em>how</em> you think. Keep in mind that there are many ways to solve an algorithm. Usually, the interviewer doesn’t care about the actual answer you come up with, but rather your <em>approach</em> to coming up with that answer.</p><p>This is why it is important for anyone preparing for a technical interview to come up with a systematic approach to problem-solving. There are many resources online that teach you ways on how to solve a problem. The examples and problem-solving approach detailed in this blog comes from a <a href="https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/">Udemy</a> course taught by Colt Steele.</p><h3>The problem-solving approach</h3><h4>1. Understand the problem and start communicating</h4><p>This sounds like a no-brainer, but it’s the most crucial to start with. When the interviewer asks you a question, they aren’t expecting you to blurt out the answer right away. Remember, you are interviewing for a position on their team. That means <strong>you are expected to clearly communicate</strong> what you will be working on so that they know they can easily collaborate with you on a project.</p><p>This step is your chance to ask clarifying questions and clearly state out-loud what you think the interviewer is asking of you. Here are some questions to go over that can help you understand the problem:</p><ul><li>Can I restate the problem in my own words?</li><li>What are the inputs that go into the problem? How about the output(s)?</li><li>Do I have enough information to solve the problem?</li><li>What are the important pieces of data the interviewer has given me? How should I label them in my code?</li></ul><p>Use these questions to help you start communicating with your interviewer. The interviewer will be glad you asked these questions and will guide you in the right direction to start solving the problem.</p><h4>2. Concrete Examples</h4><p>To further cement your understanding of the problem, come up with a few examples of your own. These examples should have different test cases so that you can cover a wide range.</p><p>To start, look at the example you were given. Usually, your interviewer will give you one or two examples with inputs and an output. You can start with one of those examples and go through how you would expect the given inputs to return the expected output.</p><p>Then you can ask aloud “what are some use cases I should consider?” This will give you the opportunity to explore examples such as “what if I was given an empty input” or “what if the input was an invalid one?” Another example to consider is “what if the size of my input increased?”</p><p>Coming up with more examples will let the interviewer know that you are thinking outside of just the given problem and bringing in real-world cases that may come up during company production.</p><h4>3. Break It Down</h4><p>Break the problem down into smaller pieces. This is the best opportunity for you to clearly communicate what you’re doing. Draw out the problem and walk through your logic. This will force you to think about the code you’ll write before you write it out.</p><p>Consider this problem: Write a function that takes in a string and returns counts of each character in the string. A break down of this problem may look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*QQzY2pSAmv8m7-NckioSYQ.png" /><figcaption>Break down the problem. <a href="https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/">Source</a></figcaption></figure><p>Notice that these are not step-by-step instructions in how you’re going to start writing your code. The problem was broken down into smaller pieces that map out<em> </em>the <em>logic</em>. Explicitly writing your steps is the only way the interviewer can see how you think.</p><p>This is also another opportunity for them to guide you in the right direction and correct you if they see any mistakes. Don’t worry, it’s okay for them to correct you. You’re going to make a lot of mistakes in production and this is a chance for them to see how receptive you are to feedback. Gracefully accept any and all feedback throughout your interview.</p><h4>4. Declare the language you’ll use and solve the problem</h4><p>At this point, the interviewer should have a good idea of whether or not to consider you for the role. If you have a solid problem-solving approach, the interviewer should get an idea of how you think. They should then feel comfortable working with you on a team. Nonetheless, the code should still be written out.</p><p>First, let your interviewer know which language you feel most comfortable using. Then, if you followed the first few steps, writing the code shouldn’t be too difficult. You clarified all the important information you need to know. You came up with examples that gave you a clear direction on what to expect. Then you broke down your steps. You already have the answer, you just have to write it into code.</p><p>This is an opportunity for the interviewer to see how comfortable you are with the language you chose. It’s okay to forget syntax and to ask your interviewer. It’s easy to forget how to write an ‘if statement’ when you have someone watching you. In the real world, you’d probably just look it up anyway.</p><p>The hard part is done, just focus on writing good code and don’t be afraid to ask for help when you need it.</p><h4>5. Look Back and refactor</h4><p>Yay, you did it! You successfully wrote the code needed to solve the problem. However, the interview is still not over. Take a look at your final code and be 100% sure that it works. Revisit the examples you came up with earlier, do they still work? If it does, and if time allows, go over the code again and start a different conversation with your interviewer — how can you make it better?</p><p>See this as an opportunity to understand how you and your interviewer can work together to refactor your code and come up with a more efficient answer. To start, ask yourself: “what is the time and space complexity of your solution?” Come up with the worst, best, and expected case. Keep working with your interviewer to see if you can come up with another solution.</p><h3>Wrapping it up</h3><p>Having a solid problem-solving approach is essential to a technical interview. After all, this is an interview, not a test. The interviewer cares more about how you solve the problem and less about the actual answer. They want to know that if they hired you on, you would be able to solve problems <em>with</em> them.</p><p>Hope this helps! If you have any tips that you found successful during your technical interviews, leave them in the comments, I’d love to hear them!</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b71627b03f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/solving-an-algorithm-in-a-technical-interview-the-problem-solving-approach-9b71627b03f7">Solving an Algorithm in a Technical Interview: The Problem-Solving Approach</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding JavaScript: Coercion in a Dynamically Typed Language]]></title>
            <link>https://levelup.gitconnected.com/understanding-javascript-coercion-in-a-dynamically-typed-language-8807d6331fa2?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/8807d6331fa2</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Sat, 19 Sep 2020 01:08:07 GMT</pubDate>
            <atom:updated>2020-09-26T23:19:57.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2kzkzWI2B50mwO-c" /><figcaption>Photo by <a href="https://unsplash.com/@acharki95?utm_source=medium&amp;utm_medium=referral">Aziz Acharki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>JavaScript is a dynamically typed language</h4><p>To understand <em>coercion</em>, we first need to recognize that JavaScript (JS) is a dynamically typed language. What does that mean? It means that JS does not require the explicit declaration of the variables before they’re used. Here is a quick example that compares Java, a statically typed language, vs. JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*NVWU-kfUNJICyhpK.png" /><figcaption>Static vs Dynamic typing example. Image <a href="https://medium.com/@kellyrschroeder/the-static-around-dynamical-languages-b52a5d083192">Source</a></figcaption></figure><p>Here we see that Java is a statically typed language. When the variable ‘name’ is created it was declared with the data type <em>String </em>and will stay a <em>String</em>. So if the variable ‘name’ is ever assigned to a different type such as a number, an error will occur. The variable is considered static.</p><p>JS on the other hand is a dynamically typed language. Notice in the example above that when the variable ‘name’ is created, it wasn’t declared with a data type. This allows the ‘name’ variable to be dynamically changed. The example above shows that ‘name’ is assigned to “John,” which is a <em>String</em>. Later, it can be assigned to 34, a <em>Number</em>. An error will not occur and JS will continue reading the code as normal.</p><h3>Coercion</h3><p>The definition of <em>coercion</em> is the practice of persuading someone to do something by using force. For JS, coercion is the concept of forcing a value to be of a certain data type. In other words, it is the conversion of a value from one type to another.</p><p>There are six primitive or simple, data types found in JavaScript:</p><pre>1. undefined  // represents a lack of existence, implicitly</pre><pre>2. null       // represents a lack of existence, explicitly</pre><pre>3. boolean    // true or false</pre><pre>4. number     // whole integers, floating integers</pre><pre>5. string     // a sequence of characters wrapped in quotes</pre><pre>6. symbol     // a unique value, introduced with ES6</pre><p>For the purpose of this blog, we’ll focus on the boolean, number, and string data types.</p><h4>Explicit vs. Implicit</h4><p>There are two ways coercion can occur: <em>explicitly</em> and <em>implicitly</em>. When a value is coerced <em>explicitly</em>, it means the code is telling the JS engine to purposely change the given value to a different type. For example:</p><pre>String(123)      // =&gt; &quot;123&quot;</pre><pre>Number(&quot;321&quot;)    // =&gt; 321</pre><pre>Boolean(0)       // =&gt; false</pre><p>These three examples show the built-in JS functions: String(), Number(), and Boolean(). Each accepts an argument of a different data type and returns that argument into the data type specified by the function’s name. So, String(123) takes in the number 123 and converts, or coerces, it to be a string “123”. Note that Boolean(0) returned the value false because the number 0 is recognized in JS to be “nothing”, or a false value. These are examples of explicit coercion.</p><p>When a value is coerced <em>implicitly</em>, it means the code doesn’t specify what the value should be. If JS isn’t told what the value has to be, it tries to guess and returns the data type that it <em>thinks</em> you want it to be. For example:</p><pre>&quot;&quot; + 123          // =&gt; &quot;123&quot; </pre><pre>if (1) {...}      // =&gt; if (true) {...}</pre><p>The first example shows an expression that uses the + operator on two different types: “” (an empty string) and 123 (a number). The JS engine was not explicitly told what the value should be so it implicitly coerces one of the given types. Since the number 123 can easily be coerced to the string “123,” it will choose to convert it to a string. In the second example, JS coerces the number 1 to the boolean true. Since JS recognizes the number 1 to be ‘something’ as opposed to the number 0 that is ‘nothing,’ it will convert number 1 to true.</p><h4>Coercion can be tricky</h4><p>Understanding the concept of coercion will help you in debugging your code. You can understand why a given value was returned as a certain data type whether you wanted it to or not.</p><p>Hope this helps you understand coercion in JS. This blog is part of a series called “Understanding Javascript.” So if you like this, make sure to follow my blog and let me know what you want me to cover if I haven’t already.</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8807d6331fa2" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/understanding-javascript-coercion-in-a-dynamically-typed-language-8807d6331fa2">Understanding JavaScript: Coercion in a Dynamically Typed Language</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Javascript: the Hoisting Phenomenon]]></title>
            <link>https://levelup.gitconnected.com/understanding-javascript-the-hoisting-phenomenon-cd8b15f6663b?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd8b15f6663b</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Wed, 09 Sep 2020 19:04:29 GMT</pubDate>
            <atom:updated>2020-09-10T10:50:12.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gmh-aePwDfsKr49P" /><figcaption>Photo by <a href="https://unsplash.com/@freiburgermax?utm_source=medium&amp;utm_medium=referral">Max Langelott</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Learning JavaScript is fun and exciting, especially when you are looking to become a frontend developer. Many frontend frameworks are all written in JavaScript such as React, Angular, and Vue. However, when starting off learning by using these frameworks, the foundations they were built on can easily be overlooked.</p><p>One concept that gets junior developers confused is the phenomenon known as <em>hoisting</em>.</p><p>To hoist something means to raise or haul up. A student that puts on their backpack could also be seen as a student who hoisted their backpack onto their shoulder. In JavaScript, hoisting refers to moving declarations (i.e. variables and functions) to the top. This is a default behavior that happens whenever a program gets executed. But what does this mean for your code?</p><p>Before we move forward I’d like to place a disclaimer. The examples shown here are pulled from a Udemy course by Anthony Alicea called <em>Javascript: Understanding the Weird Parts</em>. I feel Alicea’s examples are straightforward and I’m using them here to illustrate how hoisting works.</p><h4>Examples</h4><p>Okay, let’s do a little exercise. For those who are new to programming, continue to read along as the examples are explained in detail. For those who have a basic understanding of Javascript, take a second and answer this: What do you think the console will output for each block of code?</p><figure><img alt="Example 1" src="https://cdn-images-1.medium.com/max/410/1*G7xAnE87cMGN4kdebmSJjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*vErW32y1aOqrOwj8b5xFHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*nZkh8SgnPTvfbTGT6MK_Ew.png" /><figcaption>Examples 1, 2, and 3 (in order)</figcaption></figure><p>Let’s first breakdown each example:</p><p>In example 1, we declare a variable called ‘a’ that is assigned the string ‘Hello World.’ We also have a function called ‘b’ that will console log the string ‘Called function b!’ whenever it is executed. Moving down the code, function b gets invoked followed by a console log of the variable ‘a.’</p><p>In example 2, we start the code by invoking the function b followed by a console log of the variable ‘a.’ Moving down the code, variable ‘a’ gets declared and assigned the string ‘Hello World.’ Finally, function b is created. Variable ‘a’ and function ‘b’ are both the same in example 1 and 2.</p><p>In example 3, the code looks exactly the same as example 2, however, the variable declaration of ‘a’ is missing.</p><h4>The console’s output</h4><p>Let’s take a look at each example’s output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*ZRVnNwoD0rsQ4JnWo4FVjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*tUN3EVRqGEvsC8jV5SEDhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*oFtQ7hfUjYe3KmDWJaQeSg.png" /><figcaption>Console output of examples 1, 2, and 3 (in order)</figcaption></figure><p>In example 1, the string ‘Called function b!’ is logged to the console first followed by the variable ‘a’s assigned value ‘Hello World.’</p><p>In example 2, the string ‘Called function b!’ is logged to the console first followed by an undefined statement.</p><p>In example 3, the string ‘Called function b!’ is logged to the console first followed by a ReferenceError that says ‘a is not defined.’</p><p>Did you get it right? In each example, function b is successfully executed with ‘Called function b!’ printed to the console first. However, the variable a’s value is different in each example. This is known as the <em>hoisting phenomenon.</em></p><h3>The Hoisting Phenomenon Explained</h3><p>When a program is executed, JavaScript (JS) begins something called the Execution Context. This is basically JS’s way of setting up the environment based on the code you write. A compiler will go through your code, look for keywords JS has reserved, and set up the environment based on how it interprets your code. It is important to point out that when a compiler runs through your code it recognizes <em>where</em> you create variables and functions. JS is doing many things during the execution context to get your code ready for success. What we will focus on in this blog are the parts that contribute to the hoisting phenomenon. It happens during the two phases of the execution context: the creation phase and the execution phase.</p><h4>The Creation Phase</h4><p>During the creation phase, functions and variables are allocated memory space. However, only functions are set up in its entirety — function name, arguments, and code logic. Variables are created but are not assigned its value. Instead, it is initially assigned to a special word in JS known as <em>undefined</em>. This is simply a placeholder for a variable that says “I have space allocated for this variable but I have not assigned it to anything you declared yet.” The variable is assigned what you declared in your code <em>after</em> the creation phase and <em>during</em> the execution phase.</p><h4>The Execution Phase</h4><p>During the execution phase, JS will go through the code again but this time line by line, otherwise known as synchronous behavior. It has all the variables and functions in its memory space (created during the creation phase) and ready to do something with them. So when the variable is declared during the creation phase, it is not assigned the value you wrote for it until the execution phase. This is seen in example 2, when the console prints out undefined instead of ‘Hello World.’</p><h4>ReferenceError Explained</h4><p>In example 3, a ReferenceError is given because the variable ‘a’ was never created during the creation phase. There is no memory space allocated for this variable because it was never declared in the first place. This is where junior developers are confused because ‘undefined’ does not mean ‘not defined’ as it does in English. Undefined is a reserved word in JS to serve as a placeholder until it gets replaced by an assigned value.</p><h4>Wrapping it up</h4><p>So while hoisting means to raise or haul up, it can be seen in JavaScript as raising up the variables and functions to the top of your code during the creation phase. This is where memory space is allocated to them, waiting to be used during the execution phase.</p><p>Hope this helps you understand the hoisting phenomenon. I will be doing a series of “Understanding Javascript” concepts so please follow my blog if you’d like to read more content like this.</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd8b15f6663b" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/understanding-javascript-the-hoisting-phenomenon-cd8b15f6663b">Understanding Javascript: the Hoisting Phenomenon</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Introduction to Development Tests and the Test Pyramid]]></title>
            <link>https://levelup.gitconnected.com/a-brief-introduction-to-development-tests-and-the-test-pyramid-950939a155fe?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/950939a155fe</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 21:35:38 GMT</pubDate>
            <atom:updated>2020-08-31T21:35:38.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uMEjkFp831BPIteU" /><figcaption>Photo by <a href="https://unsplash.com/@satwinder7singh?utm_source=medium&amp;utm_medium=referral">Satwinder Singh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>This is a follow-up blog post I wrote called “<em>Test-Driven Development (TDD): why every programmer should learn it.”</em> Read it on Level Up Coding <a href="https://levelup.gitconnected.com/test-driven-development-tdd-why-every-programmer-should-learn-it-9f5e1d7b270">here</a>. Full disclosure, the concepts laid out in this blog post are derived from a Udemy course by Boris Paskhaver. Check it out <a href="https://www.udemy.com/course/testing-ruby-with-rspec/">here</a>.</blockquote><p>There are different types of tests a programmer can use when it comes to creating a test suite. This blog post aims to define those tests. We will also look at the ‘Test Pyramid,’ to get a better understanding of which tests to implement more in your test suite.</p><h4>Unit Tests</h4><p>This type of test is a way of testing a unit. The focus of a unit test is an individual unit of code in the program. Elements are tested in isolation, these are the smallest piece of code that make up a larger codebase. A unit can refer to a single class, module, object, or method. A huge advantage to unit test is it can reduce bugs in newly developed features or when changing existing functionality. One downside is that it can get tedious having to write many tests when there are many elements, or units.</p><h4>End-to-end Tests (E2E)</h4><p>This type of test focuses on a feature and its interaction with the entire system. The elements that were tested in the unit tests are tested together. An advantage of this type of test is that the completed program is tested as a whole and with a good deal of confidence. However, the downside could be that the specs are hard to write which can make them more likely to break and run slow.</p><h4>Integration Tests</h4><p>Integration tests fall somewhere in the middle between Unit and E2E tests. It doesn’t test one single unit or the program in its entirety. The focus may be a small feature and/or how two classes may work together.</p><h4>Manual Tests</h4><p>These are the tests that the programmer will manually test on their own. They will come up with different test cases to see what outputs arise from them. This should be avoided since we like having the computer runs tests for us, mostly to cut down significant time. However, manual tests are still great to have since the computer may not have caught a specific use case or the test code hasn’t been created.</p><h4>The Test Pyramid</h4><p>When it comes to writing a test suite, it’s a good idea to have all four tests together. These tests were designed to be used with each other. Unit tests should take the bulk of the test suite followed by integration tests, E2E tests, and then manual tests.</p><figure><img alt="Test Pyramid" src="https://cdn-images-1.medium.com/max/1000/0*dACFd6NgnFGma1W5.jpg" /><figcaption>Testing Pyramid. Image <a href="https://www.ministryoftesting.com/dojo/lessons/the-mobile-test-pyramid">Source</a>.</figcaption></figure><h4>Which test is best?</h4><p>The concept of this test pyramid has been around for a while, but teams still struggle to put it into practice properly. Why is that? The test suite is designed to test the program you are creating. The programmer tailors the test code that works best for the program. This is why teams struggle to implement the test pyramid because the best test suite really depends on the type of program you are building.</p><p>Thanks for reading and hope this helps clarify the different types of tests you can use when creating a test suite.</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=950939a155fe" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/a-brief-introduction-to-development-tests-and-the-test-pyramid-950939a155fe">A Brief Introduction to Development Tests and the Test Pyramid</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test-Driven Development (TDD): why every programmer should learn it]]></title>
            <link>https://levelup.gitconnected.com/test-driven-development-tdd-why-every-programmer-should-learn-it-9f5e1d7b270?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f5e1d7b270</guid>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 19:41:34 GMT</pubDate>
            <atom:updated>2020-08-24T12:28:45.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7DdFYKM-Kzq7GGTm" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank?utm_source=medium&amp;utm_medium=referral">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When it comes to programming, testing your code is just as important to a developer as the actual code itself. Some may argue that it’s even more important. Why is that, you ask? Writing your own test before you code forces you to think about how it should work. This can help you cut down on time during development, isolate specific problems or bugs, and can even avoid regressions whenever new features are added. This blog will define what TDD is and introduce the “Red, Green, Refactor” principle.</p><h4>What is TDD?</h4><p>TDD, or Test-Driven Development, is a coding pattern that helps programmers structure their code in an incremental approach. It is writing the test code, also known as a test-suite <em>before </em>you start writing code. The goal here is to force you to think about how something should work so you can build the code piece by piece.</p><p>Below is an example of a test block written in RSpec, the behavior-driven development, or BDD, language for Ruby. <em>(Note TDD and BDD have slight differences but the over-arching concept is the same — using the test suite to drive development). </em>We’ll use this example because the syntax is very readable and can help you grasp the idea quickly, in my opinion.</p><figure><img alt="Test block written with RSpec, Ruby" src="https://cdn-images-1.medium.com/max/523/1*Oz7yZx9mYEUvplrZGjI5aw.png" /><figcaption>Test Block, written in Ruby’s RSpec</figcaption></figure><p>I won’t go into detail about the syntax of the language, but this example tests for a Card class to have a type called “Ace of Spades” when a new instance is created. To make this test pass, we can approach it incrementally and:</p><ol><li>Create a Card class</li><li>Initialize it with an instance variable called ‘type’</li><li>Add a getter method to get the value</li></ol><p>Let’s execute the above test block:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*Y34e8pfuAV6fvIoLWw0lZg.png" /><figcaption>Failed test with a NameError</figcaption></figure><p>When executing this test block <em>before </em>the code is written, it failed. This is obvious because there is no code to test. The test threw a “NameError: uninitialized constant Card” because we haven’t created the Card class yet.</p><p>Let’s solve this NameError by creating the Card class. Once we created a Card class, following the TDD pattern, we would then execute the same test block. Here is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*N5McyUNED-Af0a2RXSOXYg.png" /><figcaption>Failed test with an ArgumentError</figcaption></figure><p>A new error! This means that we successfully created the Card class and can move on to the next piece of the puzzle, which is solving the ArgumentError.</p><p>This pattern of executing the test block, reading the error, solving the problem, and moving on to a new error is known as TDD. The developer is using the test suite they created to help guide them during development by building the code incrementally — piece by piece. If we continued on with the above example by following the steps we laid out earlier, we would get the test to pass. This means we have successfully met the test block expectations and created the correct code we sought out to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*VckWGNiTlFyJkOBaSx3PEg.png" /><figcaption>Passing Test</figcaption></figure><h4>Red, Green, Refactor</h4><p>The core pattern of TDD is also known as the ‘Red, Green, Refactor’ principle. Red corresponds to the errors you predictably will receive because the corresponding code hasn’t been written correctly. Green corresponds to the bare minimum code you have to write in order to make the test pass. After getting the green pass, you can refactor your code for optimization and preferred style. When refactoring your code, a red error message may occur and then you would have to re-write your code to get the green message again. This is repeated until you are happy with the refactor and the code still passes the test-suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*4XtxMGOskA-8Gkkb.png" /><figcaption>Red-Green-Refactor mantra. Image <a href="http://hanwax.github.io/2014/08/16/testing/">source</a>.</figcaption></figure><p>TDD is a powerful tool that should be used by every programmer. It will help guide you during development so you can stay focused and efficient when writing code.</p><p>Look out for a follow-up blog that explains different types of tests you can use when writing a test-suite and which one is better. The short answer — ‘it depends.’</p><p>Happy coding 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f5e1d7b270" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/test-driven-development-tdd-why-every-programmer-should-learn-it-9f5e1d7b270">Test-Driven Development (TDD): why every programmer should learn it</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hi, I’m Andy]]></title>
            <link>https://medium.com/andy-del-valle-software-engineering-portfolio/hi-im-andy-425b5e6bedfb?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/425b5e6bedfb</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[desgin]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[seattle]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Tue, 04 Aug 2020 01:00:13 GMT</pubDate>
            <atom:updated>2020-10-12T19:13:11.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3u7nPlgzesvBMUyyvLWLlg.jpeg" /><figcaption>Me smiling at my Olde English Bulldogge, Bronn</figcaption></figure><p>I’m currently residing in Seattle, WA where I have considered my home for the past two years. I was born and raised in California, but the urge for a new perspective had me itching to move, so here I am! My love for coding developed later in life, but I’m more excited than ever to pursue a career in tech and to see where this journey will take me.</p><h4>I consider myself someone who is both logical and creative.</h4><p>I have a background in healthcare, namely Nursing. I was a Registered Nurse in the Intensive Care Unit (ICU) where I cared for critically ill patients with life-threatening medical conditions. Being an ICU nurse really challenged my critical thinking skills by frequently assessing patient responses to medical treatments. I have gained invaluable experiences being at the bedside with patients and their families as they navigate through painful times in their lives. However, the lack of being creative within my career was missing and I wanted to seek out a field that nurtures both my logical and creative personalities.</p><h4>My love for coding develops.</h4><blockquote>“I think you’d be really good at coding” — A good friend</blockquote><p>It wasn’t until I was told I’d be ‘good at coding’ that I even considered a career in tech. I also don’t see much of my demographic (Filipino-American) in tech roles. I tried <em>Flatiron School’s Free Coding Bootcamp Prep</em> and fell in love! I felt that this was the perfect blend of logic and creativity. I needed to learn more, so I signed up for their immersive Software Engineering course. 15 weeks later, I graduated and gained tech skills in JavaScript, React, Ruby on Rails, and HTML/CSS.</p><p>For my final capstone project, I created “Simple Care,” a medical care management tool to help caregivers organize their loved one&#39;s medications, conditions, appointments, and clinics. I felt it was the perfect blend of testing my new learned skills while bringing in my healthcare background in Nursing. I hope to continue to build projects like these that showcase my past experiences and interests — healthcare, entertainment, dance, and nature.</p><p>As I continue my coding journey, I hope to nurture these new skills to help build dynamic and elegant websites for optimal user experiences. I also want to lead by example so that one day there would be more Filipino-American’s in tech. I am dedicating my time to sharpening my coding skills and inspiring those seeking a new career in tech to pursue their dreams.</p><p>Take care and happy coding!</p><p>— Andy del Valle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SEWkZ92Gxg03KMgAqjt8Ag.jpeg" /><figcaption>Me at Sequoia National Park, California</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=425b5e6bedfb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/andy-del-valle-software-engineering-portfolio/hi-im-andy-425b5e6bedfb">Hi, I’m Andy</a> was originally published in <a href="https://medium.com/andy-del-valle-software-engineering-portfolio">Andy del Valle | Portfolio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Information Flow in React: Data Down, Action Up]]></title>
            <link>https://medium.com/swlh/understanding-information-flow-in-react-data-down-action-up-b6c792a8b010?source=rss-c38f99f59e52------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c792a8b010</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Andy del Valle]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 02:52:21 GMT</pubDate>
            <atom:updated>2020-06-29T19:35:12.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jkE00TORR5wEyZg5" /><figcaption>Photo by <a href="https://unsplash.com/@samuelwong?utm_source=medium&amp;utm_medium=referral">Samuel Wong</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When learning React, you could easily discover the allure of component-based coding and ask yourself why you didn’t make all your previous projects on this high-advantage JavaScript library. Code re-usability, consistency, and maintainability are just a few advantages React components offer. However, when first starting off, understanding the <em>flow of information</em> between components and how to update it can be very frustrating and easily deter someone’s interest.</p><p>In this blog, we will first go over what components, state, and props are. Then we’ll go step by step on how information gets passed down for rendering and back up to update information for a DOM re-render.</p><h3>Components</h3><p>To start off, we should first recap what a React component is and why mapping them out in a component tree can save you lots of headaches when figuring out the flow of information.</p><p>According to the <a href="https://reactjs.org/docs/components-and-props.html">official React documentation</a>:</p><blockquote>Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dL1czrP7D0LIhUZfA8-XEA.png" /><figcaption>A website using React components. Image <a href="https://www.edureka.co/blog/react-components/">source</a>.</figcaption></figure><p>In the <em>Browser</em> image above, each component, distinguished by numbers, is laid out in one single page application. They each have their own functions and contain a section of code that describes what it should render to the DOM. To the right is a <em>UI Tree, </em>also known as a component tree, that helps developers map out parent components, child components, and information flow of properties — <em>props.</em></p><h3>State v Props</h3><h4>State</h4><p>This is information that <em>can</em> be mutated and lives locally in the component in which it is constructed. It can be considered the heart of the component because it is the information that ultimately gets rendered on to the DOM. You can pass down <em>state</em> from parent to child components through <em>props</em>.</p><h4>Props</h4><p>This is information that <em>can not</em> be mutated and is passed down from a parent component (information such as state or functions). It is important to note that when information gets passed down from a parent component to a child component, it can not skip “layers” of child components. So with the <em>UI Tree</em> image above, if component 1 wanted to pass down its information, via props, to component 4, it would have to get passed through component 2 first.</p><h3>“Data down, Action up”</h3><p>This phrase helps developers understand the flow of information from parent to child component and vice versa.</p><p>The first and more simple concept, “<em>data down</em>,” refers to the passing of data and/or functions via <em>props</em> from parent to child components. These props are passed down when a child component gets created. We pass data down to child components so they can render them on to the DOM.</p><h4>Data is sent down to the child from the parent component with the help of props</h4><p>Let’s breakdown this “data down” concept into steps:</p><ol><li>Parent component creates a child component</li><li>Parent component passes down data by referencing this.state via props</li><li>Child component can render the data by referencingthis.props</li></ol><p>The second and trickier concept to understand, “<em>action up</em>,” refers to sending data back up to the parent from the child component with the help of some action or event. Often these actions are connected to a callback function.</p><h4>Data is sent back up to the parent from the child component with the help of callback functions</h4><p>Let’s breakdown this “action up” concept into steps:</p><ol><li>A user interacts with a <strong>UI element</strong> (i.e. click on a button element)</li><li>An attached <strong>event listener</strong> to the UI element is triggered (i.e.onClick)</li><li>An attached <strong>handler</strong> to the event listener is triggered (i.e.handleClick)</li><li>A <strong>callback function</strong> inside the handler is triggered (i.e.onHandleClick)</li><li>Logic of the callback function is <strong>executed within the parent component</strong></li><li><strong>State is updated</strong> inside the parent component</li><li>Data is sent back down and the DOM re-renders</li></ol><p>We’ll go into more detail on each step later with the example below.</p><h3>Example: Incrementer App</h3><p>Say we have a simple ‘Incrementer’ app that shows a number on the browser. The user will be able to increment the number by clicking on the button that says “Increment Number by 1.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*_f3QgaFRbrHR0cUKFAKFrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*iRpYkmiRl182Q5qsYFqKNQ.png" /><figcaption>Left: Incrementer App on a browser; Right: UI/Component tree</figcaption></figure><h3>Data Down</h3><p>Information is passed down from the top-level component called App. Notice that the <em>state</em> includes data(a number with the value 0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*14Y8TRLSkiZiPYNCAwLDSw.png" /></figure><p>What’s passed down includes:</p><ul><li>onHandleClick={this.incrementNumber}, a callback function</li><li>number={this.state.number}</li></ul><p>We include them inside the ParentComponent tag. This is referred to as passing down <em>props- “data down.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*rIXiVRkcgHlPjcEXbaskCQ.png" /></figure><p>ParentComponent receives props from App.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*hBT6559b_-hqxTK-imtQrA.png" /></figure><p>ParentComponent renders a ChildComponent and passes down its <em>props </em>to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*QpPpJG0JsQEwjg-Ia_AH8g.png" /></figure><p>ChildComponent receives props from ParentComponent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*8ywyKt5BZn14g6an98bdxg.png" /></figure><p>ChildComponent renders the number referencing this.props.number. You can see this on the Incrementer app as the number 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*qWdy47kepI81eEHFctn_BQ.png" /></figure><h3>Action Up</h3><p>When the user interacts with the website, they see a button that says “Increment Number by 1.” The user would expect to see the number on screen increment by 1 when they click this button. How does the DOM update the number when the number that is rendered on the screen is a <em>prop</em>, data that can not be mutated? This is where it gets a bit confusing. Data can only be mutated, or updated, where it was created, in <em>state</em>.</p><p>In order for the DOM to update, data needs to be sent back up to where it was stored and then back down to where it gets rendered. In other words, data needs to somehow be sent from the child component back to its parent component where <em>state</em> was constructed, update itself, and then go back down to the child component for re-rendering. We can accomplish this through callback props.</p><p>In the “Incrementer” example, the data sent down to ChildComponent originated from App. The number: 0 lives in the <em>state </em>of App but gets rendered in the ChildComponent. So when a user clicks on the “Increment number by 1” button, number:0 needs to become number:1 but can only be updated in App.</p><p>Let’s perform our “action up” concept to illustrate this.</p><ol><li>A user interacts with<strong> a UI element. </strong>They see “Increment Number by 1” and click on the button.</li><li>The attached <strong>event listener</strong> to the UI element is triggered. You can see inside the button tag isonClick which gets triggered on a mouse click. This then triggers a function insideChildComponent called handleClick. It’s proper naming convention to start any event handler with “handle.” This way you’ll know what this function is actually doing.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*qWdy47kepI81eEHFctn_BQ.png" /></figure><p>3. The attached <strong>handler</strong> to the event listener is triggered, handleClick</p><p>4. The <strong>callback function</strong> inside the handler is triggered,onHandleClick(). It’s proper naming convention to start any callback function with the word “on” followed by the handler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*5e8hYLjgiybEbHR1IelC2g.png" /></figure><p>5. The logic of the callback function is <strong>executed within the parent component</strong>. This is seen in the function incrementNumber() below. It takes the previous state number: 0 and increments the value by 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*rVXLJEMBKFK-2s4nxCiWIA.png" /></figure><p><strong>6. The state is updated</strong> inside the parent component. number: 0 is updated to number: 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*yRUd7Ox84QGjyDU6BqT2vw.png" /></figure><p>7. Data is sent back down to ChildComponent and re-renders number: 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*842lOXYVPK4kNqs11yi-NA.png" /><figcaption>Incrementer app with the updated number after DOM re-render</figcaption></figure><h3>Information flow diagram</h3><p>Below is a diagram that helps illustrate the information flow with the Incrementer app example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNbS0xnXkGXd4n5yftwjCA.jpeg" /><figcaption>Diagram of the information flow of Incrementer app</figcaption></figure><p>Happy coding! 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c792a8b010" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/understanding-information-flow-in-react-data-down-action-up-b6c792a8b010">Understanding Information Flow in React: Data Down, Action Up</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>