<?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: Bryant Caruthers</title>
    <description>The latest articles on DEV Community by Bryant Caruthers (@bcaruthers).</description>
    <link>https://dev.to/bcaruthers</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%2F179788%2Fbbec7ffa-90de-4903-9f22-f3d1c1c77651.jpeg</url>
      <title>DEV Community: Bryant Caruthers</title>
      <link>https://dev.to/bcaruthers</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bcaruthers"/>
    <language>en</language>
    <item>
      <title>How I Made My First CodePen with the #VWC CodePen Team</title>
      <dc:creator>Bryant Caruthers</dc:creator>
      <pubDate>Wed, 03 Jul 2019 15:38:12 +0000</pubDate>
      <link>https://dev.to/vetswhocode/how-i-made-my-first-codepen-with-the-vwc-codepen-team-4oe</link>
      <guid>https://dev.to/vetswhocode/how-i-made-my-first-codepen-with-the-vwc-codepen-team-4oe</guid>
      <description>&lt;p&gt;I recently completed the &lt;a href="https://vetswhocode.io/"&gt;#Vets Who Code&lt;/a&gt; bootcamp. If you are not familiar with &lt;a href="https://vetswhocode.io/"&gt;#Vets Who Code&lt;/a&gt;, it is a veteran-led and operated 501(c)(3) charitable non-profit that focuses on training veterans in web development and software engineering principles free of charge with the focus of starting careers as javascript developers. As part of the bootcamp, we are taught HTML, CSS, JavaScript, React, JAMStack, and some computer science. Right before we graduate, we are placed on a team with other graduates to create or work on existing projects to improve the skills learned during the bootcamp. &lt;/p&gt;

&lt;p&gt;I was assigned to the CodePen team and was given the task of creating the CodePen for Independence Day as my first project. I will admit that I was a little intimidated. CodePens are seen by lots of people and being assigned to create the one for such an important holiday was pretty scary for someone fresh out of bootcamp. The requirements for the CodePen were an American flag, fireworks, and it needed to play "The Star Spangled Banner". Sounds easy enough, right?&lt;/p&gt;

&lt;p&gt;The first part of the project that I decided to tackle was the flag. I created a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for the flag and created a red rectangle in the dimensions that I wanted the flag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XBQgbsuE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562165623/flag-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XBQgbsuE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562165623/flag-1.png" alt="CSS code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I then used the &lt;code&gt;::before&lt;/code&gt; pseudo-element on the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; to create the white stripes of the flag using the CSS &lt;code&gt;box-shadow&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tuulEYwM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562165814/flag-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tuulEYwM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562165814/flag-2.png" alt="CSS code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I then used the &lt;code&gt;::after&lt;/code&gt; pseudo-element on the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; to create the blue field of stars for the flag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dh3JxSou--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562166169/flag-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dh3JxSou--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562166169/flag-3.png" alt="CSS code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the flag was finished, I created a button using the HTML &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag and added "The Star Spangled Banner" MP3 link using the HTML &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vzzFvakw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562166933/btn-html.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vzzFvakw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562166933/btn-html.png" alt="HTML code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then wrote JavaScript to have the button play "The Star Spangled Banner" when clicked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Q3j2rMZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562167042/btn-js.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Q3j2rMZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562167042/btn-js.png" alt="JavaScript code example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was able to find a recording of "The Star Spangled Banner" that was performed by the U.S. Marine Corps Band in 1953. Being a former Marine, it was really special to find this recording online. It allowed me to add a little of who I am as a veteran to the project.&lt;/p&gt;

&lt;p&gt;Once the audio and button worked, I decided to work on the fireworks. The fireworks were the most intimidating part of the project. I didn't even know where to begin. I started doing research by watching YouTube tutorials, looking at other CodePens, and searching the web. I used CSS and JavaScript to create the fireworks display. It took a lot of trial and error to get the fireworks to work as I wanted them. During this time, &lt;a href="https://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; became my friend.&lt;/p&gt;

&lt;p&gt;Once I had everything working and looking like I wanted, some fellow &lt;a href="https://vetswhocode.io/"&gt;#Vets Who Code&lt;/a&gt; alumni discovered that the stars on the flag were looking a little wonky on some browsers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YBbLNWIT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562167822/Screen_Shot_2019-07-03_at_9.30.00_AM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YBbLNWIT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1562167822/Screen_Shot_2019-07-03_at_9.30.00_AM.png" alt="wonky stars on the flag image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It looked fine on my browsers. It is really difficult to fix something that looks correct on your end. I spent three nights poring over the code and trying different things to fix the issue. This was the most frustrating part of the whole project.&lt;/p&gt;

&lt;p&gt;Here is the finished CodePen project:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/vetswhocode/embed/KjZJXQ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I learned a few important things while working on this project, besides how to write the code. One thing that I learned was to leave yourself sometime before the project is due to deal with any bugs. You never know if things might appear differently in various browsers. Another thing that I learned was don't be afraid to ask for help and ask for help early. Don't wait until the last minute to seek help. It is OK not to know how to do something. It is impossible to know how to do everything in this industry. The last thing that I learned was to not be afraid to try to code things that push you outside of your comfort zone. Being pushed outside of your comfort zone is how you grow as a developer. Just give it a try and remember to have fun with it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>css</category>
      <category>codepen</category>
    </item>
    <item>
      <title>How the Skills Learned in the Military, will Help Me to Become a Better Web Developer</title>
      <dc:creator>Bryant Caruthers</dc:creator>
      <pubDate>Wed, 19 Jun 2019 08:01:44 +0000</pubDate>
      <link>https://dev.to/vetswhocode/how-the-skills-learned-in-the-military-will-help-me-to-become-a-better-a-web-developer-3c1e</link>
      <guid>https://dev.to/vetswhocode/how-the-skills-learned-in-the-military-will-help-me-to-become-a-better-a-web-developer-3c1e</guid>
      <description>&lt;p&gt;As I am nearing the end of my &lt;a href="https://vetswhocode.io/"&gt;Vets Who Code&lt;/a&gt; bootcamp, I started to reflect, not only on the web development skills that I learned during the coding bootcamp but also on the skills that I learned while serving in the military. It is these skills that will help me to become an even better web developer. I spent eight years serving in the United States military and served in two different branches, the U.S. Marine Corps and the U.S. Navy. Each branch taught me different skills that have helped to make me who I am today. &lt;/p&gt;

&lt;p&gt;The Marine Corps prides itself on mission accomplishment. You must complete the mission at all cost, no matter the circumstance. There were times in the field where you needed to get something done, but the weather was horrible or you didn't have the proper equipment. It would've been easy to just wait until the weather was better or until you could get the proper equipment, but you have a mission that you must complete and it has to be completed on time. This has instilled in me the drive to see out all tasks to completion and to complete them by the deadline. This drive will help me as a web developer to complete any task assigned to me and to complete it on time. &lt;/p&gt;

&lt;p&gt;The Navy prides itself on its leadership. The most important leadership principle that I learned was, to know yourself and seek self-improvement. I think it is important to know your strengths and weaknesses. This helps you to focus on the areas that you need to strengthen. In the world of web development, it is very important to continually seek self-improvement. You should always seek to improve your craft and at the rate that new technology is developed, it is easy to get behind on the latest features of your primary coding language or on the latest trending framework/library.  &lt;/p&gt;

&lt;p&gt;The Navy and Marine Corps both taught me the importance of teamwork. While in the Navy, I worked as an aviation ordnance technician. Lifting heavy missiles and 500-pound bombs are impossible by yourself. It takes a team to lift them onto the wing station of an aircraft. As a web developer, you will have to work on a team and it is important to be able to work together to complete projects. Some projects are just too large to complete alone.&lt;/p&gt;

&lt;p&gt;While in the military, I got to travel the world and experience many different cultures. Cultures that are very different from that of the small farming community in North Carolina that I grew up in. But it wasn't just the different cultures overseas, it was also the different cultures that fellow service members came from. This taught me how to work with a diverse group of people and overcome cultural barriers. This experience will aid me when working with co-workers and clients, whether in person or remotely.&lt;/p&gt;

&lt;p&gt;The military taught me many skills that will help me to become a better web developer. These skills are just as valuable as the ones that I learned during my time in the &lt;a href="https://vetswhocode.io/"&gt;Vets Who Code&lt;/a&gt; bootcamp. There is more than just knowing how to code to become a web developer. You must complete projects on time, continually learn new things, be a good teammate, and most importantly, be able to get along and work with people from all walks of life.    &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>career</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Interview Questions for the Javascript Developer: Postfix &amp; Prefix Operators, Truthy &amp; Falsy Values, &amp; == vs. ===</title>
      <dc:creator>Bryant Caruthers</dc:creator>
      <pubDate>Sat, 15 Jun 2019 09:57:37 +0000</pubDate>
      <link>https://dev.to/bcaruthers/interview-questions-for-the-javascript-developer-postfix-prefix-operators-truthy-falsy-values-vs-403o</link>
      <guid>https://dev.to/bcaruthers/interview-questions-for-the-javascript-developer-postfix-prefix-operators-truthy-falsy-values-vs-403o</guid>
      <description>&lt;p&gt;In the last article, we looked at &lt;em&gt;hoisting&lt;/em&gt;, &lt;em&gt;prototypal inheritance&lt;/em&gt;, and the differences between an &lt;em&gt;attribute&lt;/em&gt; and a &lt;em&gt;property&lt;/em&gt;. You can find that article &lt;a href="https://dev.to/bcaruthers/interview-questions-for-the-javascript-developer-hoisting-prototypal-inheritance-and-attribute-vs-property-4d2b"&gt;here&lt;/a&gt;. Today, we will continue to prepare for an interview by looking at the differences between &lt;em&gt;postfix&lt;/em&gt; and &lt;em&gt;prefix increment/decrement operators&lt;/em&gt;, &lt;em&gt;truthy&lt;/em&gt; and &lt;em&gt;falsy values&lt;/em&gt;, and &lt;em&gt;equality&lt;/em&gt; vs. &lt;em&gt;identity operators&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Postfix &amp;amp; Prefix Increment/Decrement Operators
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B43AArS0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560575775/kristina-tripkovic-602495-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B43AArS0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560575775/kristina-tripkovic-602495-unsplash.jpg" alt="Mailboxes on a brick wall image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Postfix (&lt;code&gt;x++&lt;/code&gt;/&lt;code&gt;x--&lt;/code&gt;) and prefix (&lt;code&gt;++x&lt;/code&gt;/&lt;code&gt;--x&lt;/code&gt;) increment/decrement operators are used to either increase or decrease a variable by 1 and return that value. Most of us are familiar with the postfix increment operator &lt;code&gt;i++&lt;/code&gt; found in a For Loop. So if they both increase or decrease a variable by one, what's the difference?&lt;/p&gt;

&lt;p&gt;If it is used postfix (&lt;code&gt;x++&lt;/code&gt;/&lt;code&gt;x--&lt;/code&gt;), then it returns the value &lt;em&gt;before&lt;/em&gt; incrementing or decrementing the variable. Check out this example:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Postfix-example?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;If it is used prefix (&lt;code&gt;++x&lt;/code&gt;/&lt;code&gt;--x&lt;/code&gt;), it returns the value &lt;em&gt;after&lt;/em&gt; incrementing or decrementing the variable. Check out this example:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Prefix-example?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Truthy &amp;amp; Falsy Values
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rf3WKYoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560576098/obi-onyeador-559118-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rf3WKYoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560576098/obi-onyeador-559118-unsplash.jpg" alt="Bowl of candy hearts image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Truthy and falsy are funny sounding words. But, what are they? JavaScript uses type coercion, in a boolean context, on all values. When a value is evaluated in a boolean context, if the value is true it is called a truthy and if it is false it is called a falsy. All values are considered truthy, except for &lt;code&gt;false&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt;, empty strings (single quotes, double quotes, and template literals), &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, and &lt;code&gt;NaN&lt;/code&gt;, which are all falsy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Equality vs. Identity Operators
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m10LG73f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560577676/greg-jeanneau-145138-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m10LG73f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560577676/greg-jeanneau-145138-unsplash.jpg" alt="Equal stairs but diffrent colors image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So what's the difference between &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;===&lt;/code&gt;? The &lt;em&gt;equality operator&lt;/em&gt; (&lt;code&gt;==&lt;/code&gt;) compares two values for equality after any necessary type conversion. So &lt;code&gt;1 == "1"&lt;/code&gt; would return &lt;code&gt;true&lt;/code&gt;, just the same as &lt;code&gt;1 == 1&lt;/code&gt; returns true. JavaScript converts the string &lt;code&gt;"1"&lt;/code&gt; into a number and then compares it to the number &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;identity&lt;/em&gt; or &lt;em&gt;strict equality operator&lt;/em&gt; (&lt;code&gt;===&lt;/code&gt;) compares two values for equality, but there is no type conversion. So the values have to be of an equal type also. So &lt;code&gt;1 === 1&lt;/code&gt; would return &lt;code&gt;true&lt;/code&gt;, whereas &lt;code&gt;1 === "1"&lt;/code&gt; would return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I hope that this article has helped you to better understand postfix and prefix operators, truthy and falsy, and the equality and identity operators. I would like to thank all of my readers for the overwhelming support of my first article on &lt;a href="//Dev.to"&gt;Dev.to&lt;/a&gt;. I would also like to thank my instructors, Jerome Hardaway, Brad Hankee, and Phil Tenteromano, over at &lt;a href="https://vetswhocode.io/"&gt;#Vets Who Code&lt;/a&gt; for their training, support, and for pushing me to write articles. I wish you all the best of luck on your interviews and stay tuned for more articles in the series over the next few weeks.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;Photo Credits (in order of appearance):&lt;/em&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@tinamosquito?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Kristina Tripkovic"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Kristina Tripkovic&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@thenewmalcolm?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Obi Onyeador"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Obi Onyeador&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@gregjeanneau?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Greg Jeanneau"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Greg Jeanneau&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Interview Questions for the Javascript Developer: Hoisting, Prototypal Inheritance, and Attribute vs. Property</title>
      <dc:creator>Bryant Caruthers</dc:creator>
      <pubDate>Thu, 13 Jun 2019 04:00:41 +0000</pubDate>
      <link>https://dev.to/bcaruthers/interview-questions-for-the-javascript-developer-hoisting-prototypal-inheritance-and-attribute-vs-property-4d2b</link>
      <guid>https://dev.to/bcaruthers/interview-questions-for-the-javascript-developer-hoisting-prototypal-inheritance-and-attribute-vs-property-4d2b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--17Cmxadm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560393782/daniel-fazio-558736-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--17Cmxadm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560393782/daniel-fazio-558736-unsplash.jpg" alt="Macbook, Pens, Post-it Pad, and iPhone; Photo by Daniel Fazio on Unsplash"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going on a job interview is scary. It can be especially scary if you are interviewing for a new career field. Whether you just graduated from college, completed a coding bootcamp, or are a self-taught web developer, you need to make sure you are prepared for the types of questions that you may be asked during an interview. In this new series, I am going to choose a few topics that you could be asked questions about during a JavaScript frontend developer interview. I am not only doing this to help you, the reader, prepare for your upcoming interview, but I am also doing this as a way to help me prepare for my own upcoming interviews. In this article, I will cover hoisting, prototypal inheritance, and attributes vs. properties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hoisting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DhoTbkYn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560393884/samuel-zeller-368928-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DhoTbkYn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560393884/samuel-zeller-368928-unsplash.jpg" alt="Crane Hook; Photo by Samuel Zeller on Unsplash"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hoisting is where variable declarations are “hoisted” or lifted to the top of their scope. If the variable is inside a function, it is lifted to the top of the local/functional scope. If the variable is outside of a function, it is lifted to the top of the global scope. This is done regardless of where the variable declaration was made.&lt;/p&gt;

&lt;p&gt;So, if we were to write the following in the global scope:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Hoisting-Example?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;We would get back &lt;code&gt;undefined&lt;/code&gt;. The reason that we get back &lt;code&gt;undefined&lt;/code&gt; is that it is recognizing that the variable &lt;code&gt;hello&lt;/code&gt; exists, but because of hoisting, the variable declaration is hoisted to the top of the global scope, but the actual value given to the variable is not hoisted. The code is compiled as if it was written as:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Hoisting-Example-2?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Prototypal Inheritance
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IsjvuDhn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560395872/melissa-walker-horn-1072597-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IsjvuDhn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560395872/melissa-walker-horn-1072597-unsplash.jpg" alt="Man Holding Jar of Money; Photo by Melissa Walker Horn on Unsplash"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is often said that everything in JavaScript is an object. The exception is primitives (numbers, strings, booleans, undefined, and null). Functions, arrays, objects, and wrappers for strings, numbers, and booleans are all objects. Objects are used to store data, keep our code clean, and to structure applications into modules. JavaScript uses constructors or prototypes (other programming languages call these classes) as a sort of blueprint to create other objects (instances). This is typically done by creating a constructor function:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Prototypal-Inheritance?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;Once the constructor function has been defined, then you can create instances like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Prototypal-Inheritance-2?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;You might be thinking, this is cool and all, but what does this have to do with prototypal inheritance? Hang on I’m getting there.&lt;/p&gt;

&lt;p&gt;Let's define inheritance. Inheritance is simply when one object gains access to the properties and methods of another object. The term prototypal is just referring to the fact that Javascript is a prototype-based programming language.&lt;/p&gt;

&lt;p&gt;Now back to our example. Here we will add a method to calculate the age of the dogs (in dog years, of course), but we will add it outside of the constructor function using the prototype property.&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Prototypal-Inheritance-3?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;By using the &lt;code&gt;prototype&lt;/code&gt; property, the objects &lt;code&gt;fido&lt;/code&gt; and &lt;code&gt;fefe&lt;/code&gt;, have access to the method &lt;code&gt;calculateAge&lt;/code&gt;. The reason that they have access to this method is because of &lt;strong&gt;prototypal inheritance&lt;/strong&gt; (I told you that I would bring it all together). So if we were to run &lt;code&gt;fido.calculateAge()&lt;/code&gt; and &lt;code&gt;fefe.calculateAge()&lt;/code&gt;, we would get the age of the dogs in dog years. Here is the full snippet of code:&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@bcaruthers/Prototypal-Inheritance-4?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Attribute vs. Property
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JJ6d2Ctd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560395878/bruno-figueiredo-1160282-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JJ6d2Ctd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dqejlzsb4/image/upload/v1560395878/bruno-figueiredo-1160282-unsplash.jpg" alt="Government Property Sign; Photo by Bruno Figueiredo on Unsplash"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Attributes are defined by the HTML (Hypertext Markup Language). They provide additional information about the HTML elements. Examples of attributes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;href&lt;/li&gt;
&lt;li&gt;src&lt;/li&gt;
&lt;li&gt;type&lt;/li&gt;
&lt;li&gt;value&lt;/li&gt;
&lt;li&gt;alt&lt;/li&gt;
&lt;li&gt;etc…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Properties are defined by the DOM (Document Object Model). Once your browser parses your HTML elements, a DOM node is created. Because this node is an object, it has properties. Examples of properties are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accessKey&lt;/li&gt;
&lt;li&gt;attributes&lt;/li&gt;
&lt;li&gt;childElementCount&lt;/li&gt;
&lt;li&gt;className&lt;/li&gt;
&lt;li&gt;accept&lt;/li&gt;
&lt;li&gt;children&lt;/li&gt;
&lt;li&gt;etc…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main differences between attributes and properties are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attributes are defined by HTML and properties are defined by the DOM.&lt;/li&gt;
&lt;li&gt;DOM properties are initialized by HTML attributes.&lt;/li&gt;
&lt;li&gt;Attribute values cannot be changed.&lt;/li&gt;
&lt;li&gt;Property values can change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see HTML attributes and DOM properties are two different things.&lt;/p&gt;

&lt;p&gt;I hope that this article has helped you to better understand hoisting, prototypal inheritance, and the differences between HTML attributes and DOM properties. It is my even greater hope, that it will help you ace an interview and land you that frontend development job in which you are applying. I wish you the best of luck and thank you for taking the time to read this article.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;Photo Credits (in order of appearance):&lt;/em&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@danielfazio?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Daniel Fazio"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Daniel Fazio&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@samuelzeller?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Samuel Zeller"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Samuel Zeller&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@sugercoatit?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Melissa Walker Horn"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Melissa Walker Horn&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  &lt;a href="https://unsplash.com/@bfigas?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Bruno Figueiredo"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Bruno Figueiredo&lt;/span&gt;&lt;/a&gt;
&lt;/h6&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>career</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
