<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zac Heisey</title>
    <description>The latest articles on DEV Community by Zac Heisey (@zac_heisey).</description>
    <link>https://dev.to/zac_heisey</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%2F29064%2F2a615381-1a41-41e1-bb91-b17aa727e7c0.jpg</url>
      <title>DEV Community: Zac Heisey</title>
      <link>https://dev.to/zac_heisey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zac_heisey"/>
    <language>en</language>
    <item>
      <title>Objects vs. Arrays</title>
      <dc:creator>Zac Heisey</dc:creator>
      <pubDate>Thu, 25 Apr 2019 13:36:20 +0000</pubDate>
      <link>https://dev.to/zac_heisey/objects-vs-arrays-2g0e</link>
      <guid>https://dev.to/zac_heisey/objects-vs-arrays-2g0e</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hfjjhsha90pq1fnxk3g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hfjjhsha90pq1fnxk3g.jpeg"&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/photos/IKUYGCFmfw4?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Blake Connally&lt;/a&gt; on &lt;a href="https://unsplash.com/search/photos/code?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both objects and arrays are considered “special” in JavaScript. Objects represent a special data type that is &lt;a href="https://gomakethings.com/immutability-in-javascript/" rel="noopener noreferrer"&gt;mutable&lt;/a&gt; and can be used to store a collection of data (rather than just a single value). Arrays are a special type of variable that is &lt;em&gt;also&lt;/em&gt; mutable and can &lt;em&gt;also&lt;/em&gt; be used to store a list of values. So what exactly is the difference between objects and arrays, when do you use which, and how to do work with each of them?&lt;/p&gt;

&lt;h3&gt;
  
  
  Objects
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;When to Use Objects&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Objects are used to represent a “thing” in your code. That could be a person, a car, a building, a book, a character in a game — basically anything that is made up or can be defined by a set of characteristics. In objects, these characteristics are called &lt;strong&gt;properties&lt;/strong&gt; that consist of a key and a value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Basic object syntax&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Example 'person' object&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Zac&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;likesCoding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Access, Add, and Remove Items from Objects&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Properties in objects can be accessed, added, changed, and removed by using either &lt;strong&gt;dot&lt;/strong&gt; or &lt;strong&gt;bracket&lt;/strong&gt; notation. To get the value of the age key in our personobject with both dot and bracket notation, we’d write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Dot notation&lt;/span&gt;
&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="c1"&gt;// returns 33&lt;/span&gt;

&lt;span class="c1"&gt;// Bracket notation&lt;/span&gt;
&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;age&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;// returns 33&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Say we wanted to change the value of likesCoding to &lt;strong&gt;false&lt;/strong&gt;. We can do that with dot notation like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;likesCoding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if we wanted to add a new property to our person object, we could accomplish that with dot notation as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hobbies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hiking&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;travel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reading&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, to remove a property from an object, we use the delete keyword like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://codeburst.io/javascript-quickie-dot-notation-vs-bracket-notation-333641c0f781" rel="noopener noreferrer"&gt;Check out this post&lt;/a&gt; on the difference between dot and bracket notation, and when to use each.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Iterating Through Objects&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The most common way to loop through properties in an object is with a &lt;strong&gt;for…in&lt;/strong&gt; loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;myObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// logs keys in myObject&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myObject&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// logs values in myObject&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another way to iterate through object properties is by appending the &lt;strong&gt;forEach()&lt;/strong&gt; method to &lt;strong&gt;Object.keys()&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myObject&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// logs keys in myObject&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myObject&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// logs values in myObject&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Arrays
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;When to Use Arrays&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
We use arrays whenever we want to create and store a list of multiple items in a single variable. Arrays are especially useful when creating &lt;strong&gt;ordered collections&lt;/strong&gt; where items in the collection can be accessed by their numerical position in the list. Just as object properties can store values of any &lt;a href="https://javascript.info/types" rel="noopener noreferrer"&gt;primitive data type&lt;/a&gt; (as well as an array or another object), so too can arrays consist of strings, numbers, booleans, objects, or even other arrays.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Access, Add, and Remove Items from Arrays&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Arrays use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Accessing_array_elements" rel="noopener noreferrer"&gt;zero-based indexing&lt;/a&gt;, so the first item in an array has an index of 0, the second item an index of 1, and so on. For instance, let’s say we wanted to access the third item (‘Mexico City’) in the following array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;vacationSpots&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tokyo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bali&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mexico City&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vancouver&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To do so, we’d write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;vacationSpots&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="c1"&gt;// returns 'Mexico City'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Items can be added and removed from the beginning or end of an array using the push(), pop(), unshift(), and shift() methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// push() - Adds item(s) to the end of an array&lt;/span&gt;
&lt;span class="nx"&gt;vacationSpots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Miami&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// pop() - Removes the last item from an array&lt;/span&gt;
&lt;span class="nx"&gt;vacationSpots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// unshift() - Adds item(s) to the beginning of an array&lt;/span&gt;
&lt;span class="nx"&gt;vacationSpots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cape Town&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Moscow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// shift() - Removes the first item from an array&lt;/span&gt;
&lt;span class="nx"&gt;vacationSpots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Iterating Through Arrays&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
We can loop through items in an array in a few ways. First there’s the standard &lt;strong&gt;for&lt;/strong&gt;  loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// logs items in myArray&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s also the &lt;strong&gt;for…of&lt;/strong&gt;  loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// logs items in myArray&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or we can utilize the &lt;strong&gt;forEach()&lt;/strong&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// logs items in myArray&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, the similarities between iteration techniques of objects and arrays can make things confusing. Here’s a &lt;a href="https://bitsofco.de/for-in-vs-for-of/" rel="noopener noreferrer"&gt;helpful article&lt;/a&gt; to clear things up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;Objects represent “things” with characteristics (aka properties), while arrays create and store lists of data in a single variable. Both dot and bracket notation allow us to access, add, change, and remove items from an object, while zero-based indexing and a variety of built-in methods let us access and alter items in an array. Finally, we can iterate over object properties and array items using various loops (e.g. for, for…in, for…of, forEach()).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading! If you’re interested in learning more about the fundamentals of HTML, CSS, and JavaScript, follow&lt;/em&gt; &lt;a href="https://medium.com/web-dev-basics" rel="noopener noreferrer"&gt;&lt;em&gt;Web Dev Basics&lt;/em&gt;&lt;/a&gt; &lt;em&gt;on Medium. Ready to write some code? Sweet!&lt;/em&gt; &lt;a href="https://www.web-dev-basics.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Sign up for course&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and learn the basics of web development.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>4 Non-Coding Skills Every Developer Needs</title>
      <dc:creator>Zac Heisey</dc:creator>
      <pubDate>Wed, 06 Feb 2019 22:17:35 +0000</pubDate>
      <link>https://dev.to/zac_heisey/4-non-coding-skills-every-developer-needs-1hb2</link>
      <guid>https://dev.to/zac_heisey/4-non-coding-skills-every-developer-needs-1hb2</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ADRKyGbYNTKXPMCycN61gXA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ADRKyGbYNTKXPMCycN61gXA.jpeg" alt="Napolean Dynamite skills"&gt;&lt;/a&gt;Napoleon’s got skills. Do you? Image via &lt;a href="https://thebrandsmithco.com/" rel="noopener noreferrer"&gt;The Brandsmith Co.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s no doubt that if you want to be good (and employable) developer, you need to know how to write code. That’s should be pretty obvious - you wouldn’t hire a an auto mechanic who knew nothing about cars, right?&lt;/p&gt;

&lt;p&gt;Besides writing clean code, however, there are other skills that separate good developers from great ones. &lt;a href="https://medium.freecodecamp.org/the-non-code-aspects-of-us-programmers-aa663613ee92" rel="noopener noreferrer"&gt;This post&lt;/a&gt; from freeCodeCamp outlines some important skills for programmers to have that don’t involve writing code, but I wanted to add a few more of my own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Googling Skills
&lt;/h3&gt;

&lt;p&gt;Developers look stuff up online &lt;em&gt;a lot&lt;/em&gt;. Even seasoned developers with years of experience spend a good chunk of their time searching for answers or information on the internet, whether in documentation, forums, or search engines.&lt;/p&gt;

&lt;p&gt;Knowing &lt;em&gt;how&lt;/em&gt; to search for something in order to find what you’re looking for is a critical skill that can help developers of all levels. Like most things in web development, your “Googling skills” will improve with experience, but there are a few things you can do to speed the process along and get to the right answer faster:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prepend “mdn” to whatever it is you’re trying to look up. For example, if you want to know the best way to loop through items in an array, try doing a search for “mdn looping through array.” This will return a bunch of results from the &lt;a href="https://developer.mozilla.org/en-US/" rel="noopener noreferrer"&gt;MDN Web Docs&lt;/a&gt;, which is the go-to resource for all things web development. The MDN documentation might seem a little intimidating to beginner devs, but trust me - these docs will become an invaluable resource as you progress toward full-fledged programmer.&lt;/li&gt;
&lt;li&gt;No matter what you search for, you’re almost guaranteed to be served up a result from &lt;a href="https://stackoverflow.com" rel="noopener noreferrer"&gt;Stack Overflow&lt;/a&gt;, which is the largest online community of developers. This is a good and bad thing. The good part is that you can benefit from the collective knowledge of millions of developers around the world. The bad part is you’ll have to wade through some irrelevant or ineffective solutions in order to find something that works for your use case.&lt;/li&gt;
&lt;li&gt;Some developers talk trash about it, but I’ve always found &lt;a href="https://www.w3schools.com" rel="noopener noreferrer"&gt;W3Schools&lt;/a&gt; to a be a useful resource, especially as a means of decoding some of the more complex documentation found on MDN. I recommend playing around with the interactive examples that are included with most of the tutorials. They’re great for hammering home concepts in a hands-on way.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Planning Skills
&lt;/h3&gt;

&lt;p&gt;Every project you work on as a developer should involve some level of planning in order to layout a roadmap for success. Even if you adjust course as you progress (and you almost certainly will), having the skills to carefully plan out an initial route helps make your life as a developer that much easier.&lt;/p&gt;

&lt;p&gt;Planning doesn’t necessarily mean multiple iterations of wireframes and mockups before you start coding, either. It can be as simple as sketching out your ideas on paper, then spending some time thinking through how you might go about executing your plan with code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/chrisferdinandi" rel="noopener noreferrer"&gt;Chris Ferdinandi&lt;/a&gt;, who runs Vanilla JS Academy, &lt;a href="https://gomakethings.com/how-to-plan-out-your-javascript-project/" rel="noopener noreferrer"&gt;does just that&lt;/a&gt;. “Before I ever open a text editor or a browser, I plan my script out on paper. It helps me think big picture, and think through the &lt;em&gt;logic&lt;/em&gt; of my code before I get bogged down in the specific &lt;em&gt;methods&lt;/em&gt; and &lt;em&gt;tactics&lt;/em&gt; I need to implement it.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AbGLCGUCfzxd_9pXNfbwmeg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AbGLCGUCfzxd_9pXNfbwmeg.jpeg" alt="Vanilla JS script planning"&gt;&lt;/a&gt;Chris Ferdinandi plans out his scripts on paper before he writes a line of code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Determination Skills
&lt;/h3&gt;

&lt;p&gt;This one is important, especially for beginner devs struggling to grasp complex programming concepts. Make no mistake, &lt;em&gt;leaning how to code is hard&lt;/em&gt;! To be a good developer, you’ll need strong determination skills to help you persevere through those rough spots (of which there will be plenty, trust me).&lt;/p&gt;

&lt;p&gt;There are times when I spend hours, or even &lt;em&gt;days&lt;/em&gt;, stuck on a problem that I just can’t crack. I look up possible solutions on Google, search MDN’s docs, read blog posts, test stuff, fail, ask colleagues, test their suggestions, fail again, walk away for a day or two, come back to the problem, test more stuff, fail, test, fail, test…&lt;/p&gt;

&lt;p&gt;That is what becoming a web developer is all about. You need the determination to stick with project and work the pain points until you finally stumble upon the solution you’ve been looking for. That might take you 5 minutes, 5 hours, or 5 days. Doesn’t matter. What matters is that you know, no matter how long it takes, you’ll have the determination to eventually find the answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Business Skills
&lt;/h3&gt;

&lt;p&gt;Business skills are extremely valuable, whether you’re a solo freelancer or part of a huge software development team. There are &lt;em&gt;tons&lt;/em&gt; of amazing developers and engineers who write flawless code, but have no business acumen whatsoever. They aren’t able to think critically about the products or features they’re building, which means they can’t effectively communicate their ideas, concerns, etc. with marketers, managers, and stakeholders.&lt;/p&gt;

&lt;p&gt;This is a huge missed opportunity for developers who could make themselves indispensable to their teams and employers. Building up a solid repertoire of business skills - communication, negotiation, networking, marketing &amp;amp; sales, leadership, financial understanding, customer service, etc. - to complement your programming skills will you put on the fast track to job security (and likely more $$$).&lt;/p&gt;

&lt;p&gt;I’d argue that the true unicorns in the tech industry are not the fullstack devs or designer/developers, but rather people who can move effortlessly between writing code, crafting an internal email to team members, developing new promotional copy for an upcoming feature, and responding to customer inquiries. &lt;em&gt;That&lt;/em&gt;, my friends, is a unicorn.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading! If you’re interested in learning more about the fundamentals of HTML, CSS, and JavaScript, follow my Medium publication,&lt;/em&gt; &lt;a href="https://medium.com/web-dev-basics" rel="noopener noreferrer"&gt;&lt;em&gt;Web Dev Basics&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Ready to write some code? Sweet!&lt;/em&gt; &lt;a href="https://www.web-dev-basics.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Sign up for course&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and learn the basics of web development.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>ES5 vs. ES6: Functions</title>
      <dc:creator>Zac Heisey</dc:creator>
      <pubDate>Fri, 01 Feb 2019 21:29:29 +0000</pubDate>
      <link>https://dev.to/zac_heisey/es5-vs-es6-functions-2dp7</link>
      <guid>https://dev.to/zac_heisey/es5-vs-es6-functions-2dp7</guid>
      <description>&lt;h3&gt;
  
  
  Functions in ES5
&lt;/h3&gt;

&lt;p&gt;There are two ways to write functions in ES5, and both variations produce essentially the same outcome.&lt;/p&gt;

&lt;p&gt;In a &lt;strong&gt;Function Declaration&lt;/strong&gt; (sometimes referred to as a “named” function), we use the function keyword to declare our function, give it a name (sum in the example below), and use the return keyword to return the result of our statement in the code block.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AFhe2mCyAwjXb84UqSvuEwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AFhe2mCyAwjXb84UqSvuEwg.png"&gt;&lt;/a&gt;ES5 Function Declarations require parentheses and a return statement — but no semicolon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Expressions&lt;/strong&gt; (aka “Anonymous” functions) have many of the same characteristics as function declarations (basic structure, function and return keywords, etc.). However, we store function expressions in a variables, and terminate them with a semicolon (as we do with all variables in JavaScript).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AxldGC8yYhOw7lqu_7BS9cQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AxldGC8yYhOw7lqu_7BS9cQ.png"&gt;&lt;/a&gt;ES5 Function Expressions require parentheses, a return statement, and a terminating semicolon.&lt;/p&gt;

&lt;h4&gt;
  
  
  What’s the Difference Between a Function Declaration and a Function Expression?
&lt;/h4&gt;

&lt;p&gt;The key difference between function declarations and function expressions has to do with &lt;em&gt;hoisting&lt;/em&gt;. Function declarations are &lt;em&gt;hoisted&lt;/em&gt; by the browser when your script initially runs. In other words, any named functions you have in your script will be hoisted to the top of your code and interpreted &lt;em&gt;before&lt;/em&gt; any other code is executed.&lt;/p&gt;

&lt;p&gt;This means that you can actually call a named function before you’ve declared that function it in your code. Check out the example below:&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Functions in ES6
&lt;/h3&gt;

&lt;p&gt;We can still use both of the ES5 function types outlined above, but ES6 also introduced &lt;strong&gt;Arrow Functions&lt;/strong&gt; to the JavaScript landscape. Arrow functions provide a simplified structure, allowing for a more concise way to write function expressions.&lt;/p&gt;

&lt;p&gt;The syntax of an arrow function does away with the function keyword and instead uses a =&amp;gt; symbol, which is placed to the right of the parentheses containing your parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AtmUahl1hjIXeglCIyMgTZg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AtmUahl1hjIXeglCIyMgTZg.png"&gt;&lt;/a&gt;ES6 Arrow Functions have a few syntactical options, depending on the structure of the function.&lt;/p&gt;

&lt;p&gt;Arrow functions also come with some nifty shorthand options we can use to make things even more concise, depending on the required structure of our functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A0Go0vByhigVG1jtKRLgsTA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A0Go0vByhigVG1jtKRLgsTA.png"&gt;&lt;/a&gt;ES6 Arrow Functions have shorthand options depending on statements, parameters, etc.&lt;/p&gt;

&lt;p&gt;If you’d like to dive deeper into ES6 Arrow Functions and learn more about when and how you can use them, check out some of these resources and tutorials:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codeburst.io/javascript-arrow-functions-for-beginners-926947fc0cdc" rel="noopener noreferrer"&gt;JavaScript: Arrow Functions for Beginners - codeburst.io&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://dev.to/flaviocopes/a-tutorial-to-javascript-arrow-functions-4kb-temp-slug-3047174"&gt;A Tutorial to JavaScript Arrow Functions - Flavio Copes&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="noopener noreferrer"&gt;Arrow functions - MDN web docs&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://medium.freecodecamp.org/when-and-why-you-should-use-es6-arrow-functions-and-when-you-shouldnt-3d851d7f0b26" rel="noopener noreferrer"&gt;When (and why) you should use ES6 arrow functions — and why you shouldn’t - freeCodeCamp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading! If you’re interested in learning more about the fundamentals of HTML, CSS, and JavaScript, follow my Medium publication,&lt;/em&gt; &lt;a href="https://medium.com/web-dev-basics" rel="noopener noreferrer"&gt;&lt;em&gt;Web Dev Basics&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Ready to write some code? Sweet!&lt;/em&gt; &lt;a href="https://www.web-dev-basics.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Sign up for course&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and learn the basics of web development.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>7 Alternatives to the div Tag in HTML</title>
      <dc:creator>Zac Heisey</dc:creator>
      <pubDate>Wed, 30 Jan 2019 17:01:03 +0000</pubDate>
      <link>https://dev.to/zac_heisey/7-alternatives-to-the-div-tag-in-html-62i</link>
      <guid>https://dev.to/zac_heisey/7-alternatives-to-the-div-tag-in-html-62i</guid>
      <description>&lt;p&gt;In the early stages of learning how to structure an HTML document, it’s not uncommon to end up with what some developers call “&lt;a href="https://www.pluralsight.com/blog/software-development/html5-web-components-overview" rel="noopener noreferrer"&gt;div soup&lt;/a&gt;.” Need a content section your homepage? Wrap in a div! Building a sidebar? Div it up! Three column layout? Div, div, div!&lt;/p&gt;

&lt;p&gt;There isn’t anything &lt;em&gt;functionally&lt;/em&gt; wrong with writing HTML this way. Browsers will still be able to render your markup and display your content to users. The primary issue with heavy use of &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tags is that they lack semantic meaning. Writing &lt;a href="https://www.lifewire.com/why-use-semantic-html-3468271" rel="noopener noreferrer"&gt;Semantic HTML&lt;/a&gt; gives your markup meaning to web browsers and screen readers, can help with SEO, makes it easier to debug code, and more.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="http://w3c.github.io/html/grouping-content.html#the-div-element" rel="noopener noreferrer"&gt;W3C&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The div element has no special meaning at all…Authors are strongly encouraged to view the div element as an element of last resort, for when no other element is suitable. Use of more appropriate elements instead of the div element leads to better accessibility for readers and easier maintainability for authors.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, so what are these “more appropriate elements” that the W3C mentions? When HTML5 was released in 2014, it introduced some new section and grouping elements that web developers could use to enhance the semantic meaning of their markup.&lt;/p&gt;

&lt;p&gt;Let’s explore a few of the more semantic alternatives to the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Main Element
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="http://html5doctor.com/element-index/#main-desc" rel="noopener noreferrer"&gt;main&lt;/a&gt; element indicates to browsers and screen readers which portion of your markup contains the main section of content on a given page. This can help with keyboard command access, zooming on mobile browsers, and more. It should be used only once per page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Section Element
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="http://html5doctor.com/element-index/#section" rel="noopener noreferrer"&gt;section&lt;/a&gt; element is used to group content by theme and represents a section of a document or application. Sections can have their own header and footer elements, and there can be multiple section elements used on a single page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Aside Element
&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://html5doctor.com/element-index/#aside" rel="noopener noreferrer"&gt;aside&lt;/a&gt; elements are mainly used to represent part of a page containing related content to a given section. Asides are typically used as sidebars.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;aside&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"timeline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1940s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1950s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1960s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Article Element
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="http://html5doctor.com/element-index/#article" rel="noopener noreferrer"&gt;article&lt;/a&gt; element can be used for portions of content that could stand on their own. Blog posts, newspaper articles, and user comments are some possible use cases the the article element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;aside&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"timeline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1940s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1950s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1960s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"blog-posts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Why I Love Skateboarding&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;By Tony Hawk&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding is the best! I love doing gnarly tricks 🤘&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Blockquote Element
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="http://html5doctor.com/element-index/#blockquote" rel="noopener noreferrer"&gt;blockquote&lt;/a&gt; element represents content that is being quoted from an external source (a person, document, newspaper, case study, etc.). It is often accompanied by an internal &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; element to attribute the quote to its source.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;aside&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"timeline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1940s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1950s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1960s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"blog-posts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Why I Love Skateboarding&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;By Tony Hawk&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding is the best! I love doing gnarly tricks 🤘&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;blockquote&lt;/span&gt; &lt;span class="na"&gt;cite=&lt;/span&gt;&lt;span class="s"&gt;"http://www.tonyhawkshreds.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    "Skateboarding is life. The rest is just details."
    &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;- Tony Hawk&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Nav Element
&lt;/h3&gt;

&lt;p&gt;As the name implies, &lt;a href="http://html5doctor.com/element-index/#nav" rel="noopener noreferrer"&gt;nav&lt;/a&gt; elements represent the navigation section of a document. The nav element should include the primary navigation links for a give page, application, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"main-navigation"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;Introduction to Skateboards&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;aside&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"timeline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1940s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1950s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1960s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"blog-posts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Why I Love Skateboarding&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;By Tony Hawk&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding is the best! I love doing gnarly tricks 🤘&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;blockquote&lt;/span&gt; &lt;span class="na"&gt;cite=&lt;/span&gt;&lt;span class="s"&gt;"http://www.tonyhawkshreds.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    "Skateboarding is life. The rest is just details."
    &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;- Tony Hawk&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Footer Element
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="http://html5doctor.com/element-index/#footer" rel="noopener noreferrer"&gt;footer&lt;/a&gt; element represents the “footer” section of a document or section. In many websites, the footer element will contain contact and copyright information, a brief “about” blurb, social media logos and links, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"main-navigation"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;Introduction to Skateboards&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-intro"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The skateboard is the way cool kids get around.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"skateboards-history"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;History of Skateboards&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding was born in the late 1940s or early 1950s.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;aside&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"timeline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1940s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1950s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;1960s: Lorem Ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"blog-posts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Why I Love Skateboarding&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;By Tony Hawk&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Skateboarding is the best! I love doing gnarly tricks 🤘&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;blockquote&lt;/span&gt; &lt;span class="na"&gt;cite=&lt;/span&gt;&lt;span class="s"&gt;"http://www.tonyhawkshreds.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    "Skateboarding is life. The rest is just details."
    &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;- Tony Hawk&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;© 2019 Skateboards, Inc.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://twitter.com/@skateboards"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Twitter Profile&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.facebook.com/Skateboards"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Facebook Page&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- other content --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we know about some semantically optimized alternatives to the div element, how do we know when to use each of them? And when (if ever) is it ok to still use div elements in our markup? &lt;a href="http://html5doctor.com" rel="noopener noreferrer"&gt;HTML5 Doctor&lt;/a&gt; has a really handy flowchart to help answer that question:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0qmx32top4myhca5p40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0qmx32top4myhca5p40.png" alt="html5 element flowchart" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading! If you’re interested in learning more about the fundamentals of HTML, CSS, and JavaScript, follow my Medium publication,&lt;/em&gt; &lt;a href="https://medium.com/web-dev-basics" rel="noopener noreferrer"&gt;&lt;em&gt;Web Dev Basics&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Ready to write some code? Sweet!&lt;/em&gt; &lt;a href="https://www.web-dev-basics.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Sign up for course&lt;/em&gt;&lt;/a&gt; &lt;em&gt;and learn the basics of web development.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
