<?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: Hakeem Abdul</title>
    <description>The latest articles on DEV Community by Hakeem Abdul (@keemosty).</description>
    <link>https://dev.to/keemosty</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%2F435532%2F09f53654-7cfc-4f39-bd99-d05963bfb058.jpg</url>
      <title>DEV Community: Hakeem Abdul</title>
      <link>https://dev.to/keemosty</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/keemosty"/>
    <language>en</language>
    <item>
      <title>Arrays</title>
      <dc:creator>Hakeem Abdul</dc:creator>
      <pubDate>Mon, 12 Oct 2020 01:00:47 +0000</pubDate>
      <link>https://dev.to/keemosty/arrays-2ojg</link>
      <guid>https://dev.to/keemosty/arrays-2ojg</guid>
      <description>&lt;h1&gt;
  
  
  Introduction To Arrays
&lt;/h1&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602459033713%2F08Zu59N73.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602459033713%2F08Zu59N73.gif" alt="ghost.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Arrays?
&lt;/h2&gt;

&lt;p&gt;Arrays are single variables ( &lt;em&gt;objects&lt;/em&gt; ) which can  contain many data values (&lt;em&gt;types&lt;/em&gt; ) in them arranged in a list. These values are enclosed in a square brackets and are seperated from one another by a comma.&lt;/p&gt;

&lt;p&gt;An Array can  hold multiple data values in itself and therefore can store a wide range of information in its variable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An Array does not have a data type of its own. &lt;/p&gt;

&lt;p&gt;Arrays are objects &lt;/p&gt;
&lt;/blockquote&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458689803%2FSWEv3G6Zq.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458689803%2FSWEv3G6Zq.jpeg" alt="FB_IMG_15015091573116806.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Arrays are very important in the fact that they help in storing data(values) in a collective list and provides you with the easy accessiblity to get the individual content of each list item in the array and use them in your code. This beats the other alternative of you having to declare a variable individually for every single item(data) you want to use in your code.&lt;/p&gt;

&lt;p&gt;If for example, you want create a variable to store the list of the types of watches you're selling on your business website, then an array should be the way to go instead of creating different variables  for each of the watches you want to store in it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Difference Between An Array And An Object.
&lt;/h4&gt;

&lt;p&gt;If you have come across an object, then you would realize that an array and an object sometimes may get complicatedly similiar in ideas. The difference here is that an Array holds multiple data, all of which relates to certain type, purpose or kind. For example,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A list of all the names of the lawyers in a particular firm. &lt;/li&gt;
&lt;li&gt;A list of the cars driven by the employees in a hospital.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...An object on the other hand, is best used as a variable set to contain the overall information relating to a particular item.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A data set of a lawyer's fullname, age, address, eyeColor etc.

&lt;ul&gt;
&lt;li&gt;A data set of a car's name, speed rate, color, etc.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Creating An Array
&lt;/h3&gt;

&lt;p&gt;An array can be created in two ways&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;An Array constructor function&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;const myArray = new Array();&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An Array literal syntax &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;const myArray = [];&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;These arrays are all empty as there are no data values in them yet. &lt;/p&gt;

&lt;p&gt;The first way may lead to complications, it is highly recommended you use the second way(&lt;em&gt;Array literal syntax&lt;/em&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Storing Data Values In An Array
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;footballTeams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Barcelona`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Liverpool`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Chelsea`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Juventus`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the code example above, we have created a variable &lt;code&gt;footballTeams&lt;/code&gt; and assigned an array of teams listed in the square brackets all seperated by a comma from the other.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Arrays dont have to contain only  one data type (string) but can contain different data types all enclosed in the same array(string, numbers, boolean etc).&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Tino`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&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;span class="s2"&gt;`developer`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here, you'll see that the array contains different data types stored in it. This is an efficient way of storing information, profiles etc on your variables.&lt;/p&gt;

&lt;p&gt;Here's another tip! we can also store an &lt;em&gt;array(s)&lt;/em&gt;  inside another array.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;avengers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`iron man`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`captain america`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`thor`&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`hawkeye`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`falcon`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2020&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;From the code, you'll notice that inside the array, there is another array holding an information of two strings and a number.&lt;/p&gt;

&lt;p&gt;Array(s) inside another array are called &lt;strong&gt;multidimensional arrays&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Accessing Items From Arrays
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;The items or elements in an array sometimes may be needed to be accessed  and used individually or perform certain tasks like loop iteration and so on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The items in an array can be accessed using a method called the &lt;strong&gt;Bracket Notation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The items each have a number tag or position that enables them to be accessed individually. This is called the &lt;strong&gt;Index Number&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;books&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; 
    &lt;span class="s2"&gt;`comedy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`thriller`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`action`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`drama`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`sci-fi`&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this instance, we have created an array of book genres and in order to access any of them, we employ the method above called the &lt;strong&gt;bracket notation&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We do this by using the bracket symbol [] and then writing into the bracket; the index number of the array-item we intend on getting.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;index number&lt;/strong&gt; counts from &lt;code&gt;0&lt;/code&gt; for the first item. That is,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;first item = &lt;code&gt;0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;second item = &lt;code&gt;1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;third item = &lt;code&gt;2&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Computers generally start counting from &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;And so on...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Therefore...&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;let&lt;/span&gt; &lt;span class="nx"&gt;books&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; 
    &lt;span class="s2"&gt;`comedy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`thriller`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`action`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`drama`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`sci-fi`&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...accessing all array-items will then be&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;books&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;//comedy&lt;/span&gt;
&lt;span class="nx"&gt;books&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;//thriller&lt;/span&gt;
&lt;span class="nx"&gt;books&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;//action&lt;/span&gt;
&lt;span class="nx"&gt;books&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;//drama&lt;/span&gt;
&lt;span class="nx"&gt;books&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;//sci-fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Printing the code above on your browser console using the &lt;code&gt;console.log()&lt;/code&gt; will give you all the results of  all the array-items on your console. &lt;/p&gt;

&lt;p&gt;Note that we said that array and objects were different in some cases, but the truth in general is that arrays are technically still objects. Still its best to refer to them as arrays to avoid complications.&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;typeof&lt;/code&gt; operator on an array will return a result of &lt;strong&gt;object&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="s2"&gt;`basketball`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="s2"&gt;`football`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="s2"&gt;`volleyball`&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="k"&gt;typeof &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sports&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;     &lt;span class="c1"&gt;// Object&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Numbered  Indexes
&lt;/h3&gt;

&lt;p&gt;The method used in the previous example, made use of the bracket notation and the indexes of each of the elements (&lt;em&gt;items&lt;/em&gt;) in the array to access them individually.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is what is meant by arrays using numbered indexes.&lt;/p&gt;

&lt;p&gt;Arrays with named  (using letters) indexes are called associative arrays&lt;/p&gt;

&lt;p&gt;It is not advisable to use associative arrays in javascript as they lead to complications in your code&lt;/p&gt;

&lt;p&gt;Use numbered indexes instead.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;colours&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`black`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`blue`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`red`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`teal`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;// Accessing the red here&lt;/span&gt;
&lt;span class="nx"&gt;colours&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;// gets the red item with the index of 2&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;colours&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;// Prints out the result on the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Another thing to note here is that the javascript parser is white space insensitive as similar to the browser engine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, in order for a cleaner code, your array can be arranged like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;colours&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; 
    &lt;span class="s2"&gt;`black`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`blue`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`red`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`teal`&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  NOTE:
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;A function can be an element in an array&lt;/li&gt;
&lt;li&gt;An object can be an element in an array&lt;/li&gt;
&lt;li&gt;Even an array can be an element inside another array.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Properties Of An Array
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Length Property
&lt;/h3&gt;

&lt;p&gt;This is the most important property of an array and probably the only one you may need to use practically in your code.&lt;/p&gt;

&lt;p&gt;The length property is a property attached to an array (object) that calculates and outputs the number of elements (items) in an array. &lt;/p&gt;

&lt;p&gt;The length property is used to determine the number and as the name implies, the length of an array. It is very useful in loops iteration.&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;// Define an array books with elements&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;movies&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`comedy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`thriller`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`sci-fi`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`drama`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`action`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Prints the length of the array on the console&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;movies&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="c1"&gt;// 5&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The length property returns the result of 5 which is the number of the elements in the array books.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Looping Through An Array With The Length Property
&lt;/h4&gt;

&lt;p&gt;A &lt;strong&gt;For loop&lt;/strong&gt; is used best to loop through the items in an array &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: We loop through arrays in order to perform a number of operations on the items of the array based on a laid out condition.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Declaring the variables to be used in the loop iteration&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;movies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;count&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;// Initializing the array&lt;/span&gt;
&lt;span class="nx"&gt;movies&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`comedy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`thriller`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`sci-fi`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`drama`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`action`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//Initializing the variable count and assigning it to the length of the array&lt;/span&gt;
&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;movies&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="c1"&gt;//For loop iteration&lt;/span&gt;
&lt;span class="k"&gt;for &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="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;count&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="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;movies&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="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//Results will be...&lt;/span&gt;
&lt;span class="c1"&gt;//comedy&lt;/span&gt;
&lt;span class="c1"&gt;//thriller&lt;/span&gt;
&lt;span class="c1"&gt;//sci-fi&lt;/span&gt;
&lt;span class="c1"&gt;//drama&lt;/span&gt;
&lt;span class="c1"&gt;//action&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other properties of an &lt;strong&gt;array&lt;/strong&gt; are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Constructor property&lt;/li&gt;
&lt;li&gt;Prototype property&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we have gotten a pretty deep introduction to arrays, lets turn a chapter and take a look at the most important and powerful things about arrays......the &lt;strong&gt;array methods&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ARRAY METHODS
&lt;/h2&gt;

&lt;p&gt;Arrays have built-in functions that perform specific operations on the elements in the array and the array as a whole itself. These built-in functions are called &lt;strong&gt;methods&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Methods are basically special functions of &lt;em&gt;objects&lt;/em&gt; that performs certain action on them and technically &lt;strong&gt;arrays&lt;/strong&gt; can be referred to as &lt;strong&gt;objects&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Arrays have over 20 valid methods that can be used on them but we are only going to go over the major ones.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The  &lt;code&gt;Pop()&lt;/code&gt; Method
&lt;/h3&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461515310%2FjNEwZao48.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461515310%2FjNEwZao48.gif" alt="pop.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pop method &lt;em&gt;pops out&lt;/em&gt; or removes the &lt;strong&gt;last&lt;/strong&gt; element (item) from an 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;let&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`oranges`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`apples`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`pineapples`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`mangos`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nx"&gt;fruits&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;// fruits =[mangos]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;pop()&lt;/code&gt; method here removes the last item from the list, which in this case is &lt;em&gt;mangos&lt;/em&gt; and then returns a new array with the value of the element(s) that was removed. That is...&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&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="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`mangos`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This changes the initial list of the array, therefore...&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`oranges`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`apples`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`pineapples`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Using the &lt;code&gt;pop()&lt;/code&gt; method on an empty array [ ] will return the keyword &lt;code&gt;undefined&lt;/code&gt; as the result. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The  &lt;code&gt;Push()&lt;/code&gt; Method
&lt;/h3&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461560373%2FKMpDt-Y_v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461560373%2FKMpDt-Y_v.gif" alt="push.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is basically the opposite of the &lt;code&gt;pop()&lt;/code&gt; method as the &lt;code&gt;push()&lt;/code&gt; method is used to &lt;em&gt;push in&lt;/em&gt; or add an element to the &lt;strong&gt;end&lt;/strong&gt; of an 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;let&lt;/span&gt; &lt;span class="nx"&gt;languages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`english`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`spanish`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`french`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newLang&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;languages&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="s2"&gt;`hindi`&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;languages&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// ["english", "spanish", "french", "hindi"]&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;newLang&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The array &lt;code&gt;languages&lt;/code&gt; was created  and stored in it was a string of 3 words(languages).&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;push()&lt;/code&gt; method takes the parameter(s) to be added in the brackets, separated by commas. &lt;/p&gt;

&lt;p&gt;The variable &lt;code&gt;newLang&lt;/code&gt; was created and used to store the altered array created as a result of adding in a new string to the end of the array using the &lt;code&gt;push()&lt;/code&gt; method..&lt;/p&gt;

&lt;p&gt;The initial array &lt;code&gt;languages&lt;/code&gt; is now modified . It now produces a result of four strings including the newly added one.&lt;/p&gt;

&lt;p&gt;The variable &lt;code&gt;newLang&lt;/code&gt; produces a result of &lt;code&gt;4&lt;/code&gt; which is now the length of the new array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;Unshift()&lt;/code&gt; Method
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;unshift()&lt;/code&gt; method is used to add new element(s) to the beginning of an array. This works like the previous &lt;code&gt;push()&lt;/code&gt; method, only that instead of adding element(s) to the &lt;strong&gt;end&lt;/strong&gt; of the array, the &lt;code&gt;unshift()&lt;/code&gt; method adds from the &lt;strong&gt;beginning&lt;/strong&gt; of the 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="c1"&gt;// Initializes the tvSeries array&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tvSeries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;`The Walking dead`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`Game Of Thrones`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;`Into The Badlands`&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//Adds new elements to the tvSeries array using the unshift() method and then stores the result in the newList variable&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tvSeries&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="s2"&gt;`The Witcher`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Blackish`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints the result of the newly altered array on the console&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;tvSeries&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints the results of the length of the altered array on the console&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;newList&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457866555%2F54Ezy1TK1.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457866555%2F54Ezy1TK1.png" alt="array_unshift_pic1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457881488%2FNGgCoQrXH.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457881488%2FNGgCoQrXH.png" alt="array_unshift_pic2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The  Shift() Method
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;shift()&lt;/code&gt; method is the opposite of the previous &lt;code&gt;unshift()&lt;/code&gt; method. The &lt;code&gt;shift()&lt;/code&gt; method is used on arrays to remove or &lt;em&gt;shift out&lt;/em&gt;  the first element in a list.&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;//Creates a entertainers array with three strings data&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;entertainers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Davido`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Burna Boy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Wizkid`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//Creates a removed variable, removes the first element from the original array and saves the results in the variable &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;removed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;entertainers&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;span class="c1"&gt;//Prints out the results of the altered array on the console&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;entertainers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints out the result of the first element that was removed on the console&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;removed&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457937759%2FEaqmKBo01.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457937759%2FEaqmKBo01.png" alt="array_shift_pic1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457954446%2FmpGzBiEyL.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602457954446%2FmpGzBiEyL.png" alt="array_shift_pic2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;Concat()&lt;/code&gt; Method
&lt;/h3&gt;

&lt;p&gt;This method is used to concatenate (add) two or more arrays together.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A new array is created to store the results of the added arrays. The original arrays are left untouched.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="c1"&gt;//First array&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;oldArtistes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Davido`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Burna Boy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Wizkid`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//Second array&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newArtistes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;`Fireboy`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Rema`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Omah Lay`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//Adds the two arrays with the concat() method and stores it in the allArtistes variable&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;allArtistes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;oldArtistes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newArtistes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints the results of the first array which still remains the same&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;oldArtistes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints the results of the second array which stays the same&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;newArtistes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Prints the results of two arrays merged  together into one&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;allArtistes&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458034583%2FIrorXOUgK.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458034583%2FIrorXOUgK.png" alt="array_concat.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: In a case of adding more than one arrays, the same method is employed, only in this case...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The arrays to be added are put in the parantheses seperated from each other with a comma, e.g:&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;let&lt;/span&gt; &lt;span class="nx"&gt;totalArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;array1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;array3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;array4&lt;/span&gt;&lt;span class="p"&gt;....&lt;/span&gt;&lt;span class="nx"&gt;arrayn&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The &lt;code&gt;Join()&lt;/code&gt; Method
&lt;/h3&gt;

&lt;p&gt;This method as the name implies &lt;strong&gt;joins&lt;/strong&gt; all the elements in the array and returns them in a &lt;em&gt;string format&lt;/em&gt;. The unique thing about this method is the fact that you can specify the separator used to separate the elements (, * - .etc)&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;let&lt;/span&gt; &lt;span class="nx"&gt;countries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Nigeria`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Ghana`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Egypt`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;elements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;`Hydrogen`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Oxygen`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Carbon`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;athletes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Ronaldo`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Jordan`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Anthony`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;//uses a * operator to seperate the elements&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;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`*`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;//uses a , operator to seperate&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;elements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`,`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;//Uses a  (backspace) to seperate&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;athletes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;` `&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458093133%2FD3KisEEUA.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458093133%2FD3KisEEUA.png" alt="array_join.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;join()&lt;/code&gt; method by default uses the comma ( &lt;strong&gt;,&lt;/strong&gt; ) operator to seperates the elements&lt;/li&gt;
&lt;li&gt;The operator to be used in the &lt;code&gt;join()&lt;/code&gt; method is to be put in the parantheses and inside the &lt;strong&gt;backticks&lt;/strong&gt; ( &lt;em&gt;ES6 template literal&lt;/em&gt; ).&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;Splice()&lt;/code&gt; Method
&lt;/h3&gt;

&lt;p&gt;This method is used to add, remove or replace element(s) in an array.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;

&lt;p&gt;The syntax of the &lt;code&gt;splice()&lt;/code&gt; method is a little tricky...&lt;br&gt;
The &lt;code&gt;splice()&lt;/code&gt; method takes three parameters into its parameters which are&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;The index position of the element(s): this is the index number  to start the counting from..&lt;/li&gt;
&lt;li&gt;The number of elements to be removed from the array&lt;/li&gt;
&lt;li&gt;The new element(s) to be added (*if two or more, separate with a comma)&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;testArray.splice( index number, No of elements to be removed, newelement1, newelement2....newelementn)&lt;/code&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;planets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`mercury`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`venus`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`jupiter`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`saturn`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;splicedPlanets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;planets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splice&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`earth`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`mars`&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;planets&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;splicedPlanets&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458129480%2FwspOU1-9w.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458129480%2FwspOU1-9w.png" alt="array_splice_pic1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The array &lt;code&gt;planets&lt;/code&gt; was declared, and four string data was stored in it.&lt;/li&gt;
&lt;li&gt;A variable &lt;code&gt;splicedPlanets&lt;/code&gt; was created, and it was used to store the results of the product of the &lt;code&gt;splice()&lt;/code&gt; method on the &lt;code&gt;planets&lt;/code&gt; array.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;splice()&lt;/code&gt; method based on its parameters given was used to add two new elements into the array.&lt;/li&gt;
&lt;li&gt;The method started its counting from index number &lt;code&gt;2&lt;/code&gt; which was &lt;code&gt;jupiter&lt;/code&gt;, it cuts out none of the elements due to its value for the &lt;em&gt;no-of-elements-to-be-removed&lt;/em&gt; being &lt;code&gt;0&lt;/code&gt;, finally it places(adds) the two strings in its parameter in front of index no &lt;code&gt;2&lt;/code&gt; where it started its count from. Hence its results..&lt;/li&gt;
&lt;li&gt;If you noticed, the last result that was printed on the console returned an empty array &lt;code&gt;[ ]&lt;/code&gt;, this is because elements were added and not removed, so there wasnt any element(s) left to be returned to the new array stored in the &lt;code&gt;splicedPlanets&lt;/code&gt; variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Another Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;boardGames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`scrabble`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`monopoly`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`yahtzee`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`ludo`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`risk`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`clue`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;splicedGames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boardGames&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splice&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`battleship`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`candy land`&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;boardGames&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;splicedGames&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458262126%2FDNQwjFvPv.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458262126%2FDNQwjFvPv.png" alt="array_splice_pic2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;boardGames&lt;/code&gt; array was created and used to store 6 strings&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;splicedGames&lt;/code&gt; variable was created and used to store the product of the &lt;code&gt;splice()&lt;/code&gt; method on the array.&lt;/li&gt;
&lt;li&gt;The first parameter in the &lt;code&gt;splice()&lt;/code&gt; method is &lt;code&gt;2&lt;/code&gt;, which means the counting started from index position &lt;code&gt;2&lt;/code&gt; (&lt;code&gt;yahtzee&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The second parameter is &lt;code&gt;2&lt;/code&gt; which means the &lt;em&gt;no-of-elements-to-be-removed&lt;/em&gt;  was two (&lt;code&gt;yahtzee&lt;/code&gt; &amp;amp; &lt;code&gt;ludo&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The last parameter which took in the new element(s) was contained by two strings (&lt;code&gt;battleship&lt;/code&gt; &amp;amp; &lt;code&gt;candy land&lt;/code&gt;). Therefore, this new elements replaced the position of the ones that were removed from the array.
Hence the results...&lt;/li&gt;
&lt;li&gt;Again, if you notice that the last result on the console is giving us an array with two strings. This strings are the ones that were removed from the array and then finally  returned to this new array that was stored in the &lt;code&gt;splicedGames&lt;/code&gt; variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;Slice()&lt;/code&gt; Method
&lt;/h3&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461603159%2FILdbw-hcN.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461603159%2FILdbw-hcN.gif" alt="slice.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This method is often confused with the &lt;code&gt;splice()&lt;/code&gt; method, because of how they both sound and thier functions.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;slice()&lt;/code&gt; method is used to &lt;em&gt;slice out&lt;/em&gt; or cut out a piece (copy) of the elements of an array based on its parameters given. It creates a new array for the piece that was cut out from the original array.&lt;/p&gt;

&lt;h4&gt;
  
  
  Syntax
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;slice()&lt;/code&gt; method takes in two parameters...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first parameter is the starting index number.&lt;/li&gt;
&lt;li&gt;The second parameter (&lt;em&gt;optional&lt;/em&gt;) is the ending index number.
&amp;gt;NOTE:  The ending parameter is optional, since the first describes where to start from when slicing out the elements from the array, if the ending parameter is not defined, the rest of the element is cut out from the array starting from the index position in the first parameter.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pizzas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`cheese`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`veggie`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`pepperoni`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`buffalo`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`margherita`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`hawaiian`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;slicedPizzas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pizzas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&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="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;pizzas&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;slicedPizzas&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458304405%2FRWIvynWfJ.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458304405%2FRWIvynWfJ.png" alt="array_slice_pic1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The array &lt;code&gt;pizzas&lt;/code&gt; was created, and 6 strings were stored in it.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;slicedPizzas&lt;/code&gt; variable was created and used to store the product of the &lt;code&gt;slice()&lt;/code&gt; method on the array.&lt;/li&gt;
&lt;li&gt;The method took one parameter &lt;code&gt;2&lt;/code&gt; which was the starting index number (ending parameter optional).&lt;/li&gt;
&lt;li&gt;From the index position of &lt;code&gt;2&lt;/code&gt;: (&lt;code&gt;pepperoni&lt;/code&gt;), the rest of the elements in the array was cut out. This is because the ending parameter wasnt defined. Hence the results...&lt;/li&gt;
&lt;li&gt;Lastly, you'll notice that the original array results printed on the console stayed intact, this is because only a copy of the &lt;em&gt;sliced&lt;/em&gt; array was cut out.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Another Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;music&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`jazz`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`rock`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`pop`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`hip hop`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`classical`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`afro beats`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;slicedMusic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;music&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&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;music&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;slicedMusic&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458324453%2Fy1eBhOP0z.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458324453%2Fy1eBhOP0z.png" alt="array_slice_pic2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The array &lt;code&gt;music&lt;/code&gt; was created, and 6 strings were stored in it.

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;slicedMusic&lt;/code&gt; variable was created and used to store the product of the &lt;code&gt;slice()&lt;/code&gt; method on the array.&lt;/li&gt;
&lt;li&gt;The method took two parameters &lt;code&gt;1&lt;/code&gt; &amp;amp; &lt;code&gt;3&lt;/code&gt; which were the starting index number and the ending index number respectively.&lt;/li&gt;
&lt;li&gt;From the starting index position of &lt;code&gt;1&lt;/code&gt;: (&lt;code&gt;rock&lt;/code&gt;) to the the ending index position of &lt;code&gt;3&lt;/code&gt; (&lt;code&gt;hip hop&lt;/code&gt;), the elements in between the defined positions in the array were all  cut out &lt;strong&gt;excluding&lt;/strong&gt; the last index which was &lt;code&gt;3&lt;/code&gt;: &lt;code&gt;hip hop&lt;/code&gt;. Hence the results...&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  The &lt;code&gt;Sort()&lt;/code&gt; Method
&lt;/h4&gt;

&lt;p&gt;This method is used to compare and arrange elements of an array in an ordered pattern. The default pattern is &lt;strong&gt;alphabetically&lt;/strong&gt; (for letters) and &lt;strong&gt;ascending&lt;/strong&gt; (for numbers).&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;let&lt;/span&gt; &lt;span class="nx"&gt;shoeBrands&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`vans`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`jordan`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`puma`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`adidas`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`reebok`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`nikes`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sortedBrands&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;shoeBrands&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&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;shoeBrands&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;sortedBrands&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458368193%2F4qo6sWejl.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458368193%2F4qo6sWejl.png" alt="array_sort_pic1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The array &lt;code&gt;shoeBrands&lt;/code&gt; was created and 6 strings were stored in it.&lt;/li&gt;
&lt;li&gt;The variable &lt;code&gt;sortedBrands&lt;/code&gt; was created and used to store the product of the &lt;code&gt;sort()&lt;/code&gt; method on the array.&lt;/li&gt;
&lt;li&gt;The two results are all the same on the console as the method arranges all the elements in alphabetical order and alters the original order of the array.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Another Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;79&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&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;numbers&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458388153%2FL0s_sxNcn.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458388153%2FL0s_sxNcn.png" alt="array_sort_pic2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;numbers&lt;/code&gt; array was created and used to store 4 number data types.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sort()&lt;/code&gt; method was used on the array.&lt;/li&gt;
&lt;li&gt;Although, the largest number there was &lt;code&gt;10000&lt;/code&gt;, it came second as sorted out by the method. This is because computers generally operates on &lt;code&gt;1&lt;/code&gt;'s and &lt;code&gt;0&lt;/code&gt;'s, therefore according to computer maths(binary), &lt;code&gt;10000&lt;/code&gt; &amp;lt; &lt;code&gt;25&lt;/code&gt; &amp;amp; &lt;code&gt;79&lt;/code&gt;. Hence the results...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;Reverse()&lt;/code&gt; Method
&lt;/h3&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461666382%2FB9i5nEc07.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602461666382%2FB9i5nEc07.gif" alt="reverse.gif"&gt;&lt;/a&gt;&lt;br&gt;
The &lt;code&gt;reverse()&lt;/code&gt; method as the name implies is used to reverse the order of elements in an 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;let&lt;/span&gt; &lt;span class="nx"&gt;routine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`wake up`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`say a prayer`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`brush my teeth`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`take a bath`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`go to work`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`sleep`&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;reversedRoutine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;routine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reverse&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;routine&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;reversedRoutine&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://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458413059%2FTs5e1ULYC.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458413059%2FTs5e1ULYC.png" alt="array_reverse.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Explanation
&lt;/h4&gt;

&lt;p&gt;Without a need for much explanation, the workings of the &lt;code&gt;reverse()&lt;/code&gt; method are quite obvious. It reverses the order or arrangement of the array and returns a new array with the elements arranged backwards. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: The original array is now altered and will give the same results as when its reversed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458636584%2FVNVxsP4ym.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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602458636584%2FVNVxsP4ym.png" alt="vlcsnap-2020-10-01-09h12m14s550.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This has been a pretty long ride, hope you enjoyed it. As much as we did, not all of the array methods were covered in this article for the sake of length and  the case of &lt;em&gt;too-much-information-ritis&lt;/em&gt; . Some important ones left out were&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;forEach()&lt;/code&gt; &lt;/li&gt;
&lt;li&gt; &lt;code&gt;map()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;filter()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt; &lt;code&gt;reduce()&lt;/code&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;You"ll want to check this ones out as they are really powerful too when it comes to &lt;strong&gt;array iteration&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  THANK YOU!
&lt;/h3&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.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602460475816%2F9Xe0k1zCc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1602460475816%2F9Xe0k1zCc.gif" alt="success.gif"&gt;&lt;/a&gt;&lt;br&gt;
Thank you for reading, your time invested is appreciated. Please leave a message if you found this article helpful or you have more to contribute.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>INTRO INTO FUNCTIONS IN JAVASCRIPT</title>
      <dc:creator>Hakeem Abdul</dc:creator>
      <pubDate>Sat, 22 Aug 2020 00:46:01 +0000</pubDate>
      <link>https://dev.to/keemosty/intro-into-functions-in-javascript-540c</link>
      <guid>https://dev.to/keemosty/intro-into-functions-in-javascript-540c</guid>
      <description>&lt;h1&gt;
  
  
  WHAT IS A FUNCTION
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Function&lt;/strong&gt; is an important concept in javascript as it forms a fundamental foundation on which you  program your code to run. A &lt;strong&gt;function&lt;/strong&gt; comprises of statements enclosed in block of codes that runs by performing a specific tasks that you've programmed into it. &lt;/p&gt;

&lt;p&gt;Functions enables you to use code repeatedly without having to type the code individually anytime you want to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  A FUNCTION SYNTAX:
&lt;/h3&gt;

&lt;p&gt;-Firstly, you start with writing in the keyword of 'function' e.g  &lt;code&gt;function&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;-Then you follow with the name of the function adding parantheses at the end of the name e.g &lt;code&gt;myFunction();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;-Parameters can be added into the parantheses, it is optional. &lt;/p&gt;

&lt;p&gt;-lastly, you add curly braces to the syntax. e.g &lt;code&gt;function myFunction(){}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fydb9pxk8joou006d6x7w.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fydb9pxk8joou006d6x7w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The function name is allowed to contain digits, underscores, and dollar signs also.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The most used syntax of naming a function is joining one lowercase name to another name but  this with a capitalized first letter in it,this method of writing is called the &lt;strong&gt;camel case&lt;/strong&gt; method. &lt;br&gt;
Example. &lt;br&gt;
&lt;code&gt;function alertUser(){}&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is a widely used convention that makes the name of your functions or variables more readable and neat when you're going through your code&lt;/p&gt;

&lt;p&gt;In a case where there are more than one parameters in the brackets, it is seperated using a comma.&lt;/p&gt;

&lt;p&gt;The name of the function is case-sensitive &lt;/p&gt;

&lt;p&gt;The curly brackets is used to contain the block of codes that is to be run by the function &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  LETS WRITE SOME CODES...
&lt;/h3&gt;

&lt;p&gt;As we noted earlier, the codes that you intend to execute should be put into the curly braces.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzsrkzgq0nvtpmhj3yv85.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzsrkzgq0nvtpmhj3yv85.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Now the code&lt;code&gt;console.log()&lt;/code&gt; has been used to output a value on your browser console, but for this to work, the &lt;strong&gt;function&lt;/strong&gt; needs to be &lt;em&gt;called upon&lt;/em&gt; or &lt;strong&gt;invoked&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;This activates the code in the &lt;strong&gt;function&lt;/strong&gt;. A &lt;strong&gt;function&lt;/strong&gt; by default is initially stored in memory by javascript, but needs to be &lt;strong&gt;invoked&lt;/strong&gt;(called) in order to retrieve the saved data of the function from the memory, and activate the set of codes that are in it to be used.&lt;/p&gt;

&lt;p&gt;You do this by writing the name of the code outside the function, that is outside the curly braces of the function including its brackets in the name, and then ending it with a semi-colon.&lt;br&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%2Fi%2F23hlq2qnc3qpbdaiilck.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F23hlq2qnc3qpbdaiilck.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3x9xvmfae09r82a67p7e.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3x9xvmfae09r82a67p7e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The brackets has to be added to the name of the function in order to invoke it.&lt;/p&gt;

&lt;p&gt;A function can also be invoked when an 'event' occurs e.g when you click a button on a page. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;An Example Of A Click Event&lt;/strong&gt;:&lt;br&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%2Fi%2F0buu17ue5rcbv58b1swn.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0buu17ue5rcbv58b1swn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  RESULTS(before click)
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqyksx48l8o8253dokttz.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqyksx48l8o8253dokttz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  RESULTS (after click)
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F21l85e0jm743y2roau2n.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F21l85e0jm743y2roau2n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  PARAMETERS AND ARGUMENTS
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt; and &lt;strong&gt;arguments&lt;/strong&gt; are like a &lt;em&gt;name to value pair&lt;/em&gt; respectively but this way is different from the ones you might have used in other areas of code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt; are like input variables(reservoirs or containers) that recieve values from arguments, and are constant initially until arguments(values) are passed into them. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Arguments&lt;/strong&gt; are the values that are given to the parameter variable to be used in the program.&lt;/p&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;p&gt;Parameters accept any name format that is given to it, that is you can name it whatever and however you want.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2qv9og1v4nzuymun4wt4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2qv9og1v4nzuymun4wt4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here it can be seen that the parameter has been put into the brackets(&lt;code&gt;stack&lt;/code&gt;) and the block of code is me using a &lt;code&gt;console.log&lt;/code&gt; to output a string value and then concatenating(using the + operator to join two values together) it with the parameter '&lt;code&gt;stack&lt;/code&gt;'. &lt;/p&gt;

&lt;p&gt;Then the function has been called outside of it using its name, inside the brackets of the function name, the argument which now holds the string value of '&lt;code&gt;front-end developer&lt;/code&gt;'.&lt;/p&gt;

&lt;p&gt;When this function is &lt;strong&gt;invoked&lt;/strong&gt; and it gets executed, the value of the argument is passed into the parameter variable which is  then used when it is concatenated with the string value in the &lt;code&gt;console.log&lt;/code&gt; output.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fes6wdstd695bjjfg568c.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fes6wdstd695bjjfg568c.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  USING MORE THAN ONE PARAMETERS AND ARGUMENTS
&lt;/h3&gt;

&lt;p&gt;Now, in a case where you intend to use more than one parameters in your function code, these are the steps to follow&lt;/p&gt;

&lt;p&gt;-You simply put in the parameter in the function name brackets separating it from the other with a comma and so on.&lt;/p&gt;

&lt;p&gt;-The arguments should also be separated with a comma and should be placed in the order of the parameters that they are being passed into&lt;/p&gt;

&lt;h4&gt;
  
  
  THE CODE:
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsyh71wofqi332cwab60d.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsyh71wofqi332cwab60d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  THE RESULTS:
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg6hkjdea7qje83olnjt.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg6hkjdea7qje83olnjt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SOME DEFAULT ACTIONS:
&lt;/h3&gt;

&lt;p&gt;In a case, where a function is invoked with more parameters than arguments in a code, then after executing the code and setting the arguments(value) to the parameters, pair by pair, then the remaining argument(s) without a parameter to be passed into will be set to '&lt;strong&gt;undefined&lt;/strong&gt;'.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe0i6648n7e7vy1p0vkbv.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe0i6648n7e7vy1p0vkbv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2qpi7cgai9ztz45hprrm.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2qpi7cgai9ztz45hprrm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the code and result shown, you'll notice that i used an ES6 syntax to write in the values of the strings and the variables(parameters).&lt;/p&gt;

&lt;p&gt;If you are not yet familiar with ES6, i'll recommend checking out this &lt;a href="https://m.youtube.com/watch?v=WZQc7RUAg18" rel="noopener noreferrer"&gt;Dev Ed&lt;/a&gt; youtube tutorial.&lt;/p&gt;

&lt;p&gt;Back to the topic, from the code above, three parameters(name, age, hobby) have all been defined in the function, but there are only two corresponing arguments ('Hakeem', 19)available to be passed into them. &lt;/p&gt;

&lt;p&gt;Therefore, when the values of the arguments have been passed into the recieving parameters(name, age), the remaining parameter(hobby), gets set to the default data of 'undefined', and gets outputed as so, because there isnt any available value to be passed into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is just a brief and basic introduction into the concept of a  function in javascript. There is more to it than this so if you intend to go in deeper and understand the whole concept, i would recommend you checking out the &lt;a href="https://www.w3schools.com/js/js_function_definition.asp" rel="noopener noreferrer"&gt;w3schools&lt;/a&gt; function lessons on their website or &lt;a href="https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions" rel="noopener noreferrer"&gt;freecode&lt;/a&gt; curriculum on javascript.Thank you for reading and goodluck on your coding journey!!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>UNDERSTANDING THE HOISTING CONCEPT IN JAVASCRIPT</title>
      <dc:creator>Hakeem Abdul</dc:creator>
      <pubDate>Sun, 09 Aug 2020 23:58:33 +0000</pubDate>
      <link>https://dev.to/keemosty/understanding-the-hoisting-concept-in-javascript-42jl</link>
      <guid>https://dev.to/keemosty/understanding-the-hoisting-concept-in-javascript-42jl</guid>
      <description>&lt;h1&gt;
  
  
  HOISTING IN JAVASCRIPT
&lt;/h1&gt;

&lt;p&gt;Before i go in to explaining what hoisting is and how it works on a javascript engine, i would like to give a  definition of an important term in javscript called the &lt;strong&gt;execution context&lt;/strong&gt;.The &lt;strong&gt;execution context&lt;/strong&gt; is somewhat like a global wrapper that contains and handles the multiple codes that runs on our javascript engine. The &lt;strong&gt;execution context&lt;/strong&gt; controls the order and the path through which codes are processed in the '&lt;em&gt;Behind-the-scenes part of the engine'. Whenever code is run in javascript&lt;/em&gt;, it is run inside the &lt;strong&gt;execution context&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Note that the execution context is an abstract concept that illustrates an enviroment where the codes you write runs and gets executed in your javascript engine.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This execution context works in two phases basically in the javascript engine 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Firstly, when the code is run, the &lt;strong&gt;execution context&lt;/strong&gt; is created, then the  javascript engine  organizes and stores the variables and functions in a memory space .&lt;/li&gt;
&lt;li&gt;Secondly,  it processes your code line after lines, reading and parsing the data on the line.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;-The first step describes the term "hoisting", but i would still like to explain further on this term, so i wouldnt stop reading just yet . There is more i would like you to get, to ensure you solidify your understanding of what "hoisting" means.&lt;br&gt;
-The variables and functions are initially sitting in memory(existing) until they are being called into use, then the javascript engine retrieves them.&lt;br&gt;
-Your code is not what is really given to the computer directly rather, it is translated and converted by the compiler to data that the computer system can understand and execute. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  WHAT  SEEMS LIKE BUT ISNT HOISTING
&lt;/h2&gt;

&lt;p&gt;Contrary to how it may seem, hoisting isnt a default response of javascript that physically moves the declarations of  variables and functions to the top stack of your code to run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EXAMPLE 1&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SmB9UC_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/on1tehh5swghi16hmcr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SmB9UC_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/on1tehh5swghi16hmcr0.png" alt="Alt Text" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this example, it can be seen that in the code, the &lt;strong&gt;function&lt;/strong&gt; has been called from the top and the &lt;strong&gt;variable&lt;/strong&gt; &lt;em&gt;outputed&lt;/em&gt; from the top using the &lt;code&gt;console.log&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cfX2YiHr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8f4hgwyngina2ke4a2c5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cfX2YiHr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8f4hgwyngina2ke4a2c5.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the result in the console of the browser, the &lt;strong&gt;function&lt;/strong&gt; has been called but the &lt;strong&gt;variable&lt;/strong&gt; is '&lt;strong&gt;undefined&lt;/strong&gt;'. Why did only the function work?, does &lt;strong&gt;hoisting&lt;/strong&gt; only work for &lt;strong&gt;functions&lt;/strong&gt;?, you might ask. But the fact is that &lt;strong&gt;hoisting&lt;/strong&gt; actually works for both of them and it did work! but it just didnt give what you'd expect. The reason for this is that &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When your code was run, the &lt;strong&gt;execution context&lt;/strong&gt; was created(that abstract enviroment where codes are managed and compiled) in two phases; storing the &lt;strong&gt;functions&lt;/strong&gt; and &lt;strong&gt;variables&lt;/strong&gt;, and then processing the code. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;function&lt;/strong&gt; was stored in 'whole', meaning that the function itself(&lt;code&gt;myFunction&lt;/code&gt;) and the string data it held("&lt;code&gt;function has been called&lt;/code&gt;") were all stored in memory for use. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And so it didnt matter that it was called some lines before actually getting to the function itself because during the first phase of the &lt;strong&gt;execution context&lt;/strong&gt;, it was already existing in memory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But in the case of a &lt;strong&gt;variable&lt;/strong&gt;, it is not the same story. This is because only the &lt;em&gt;declaration&lt;/em&gt; of the &lt;strong&gt;variable&lt;/strong&gt;(&lt;code&gt;var x&lt;/code&gt;) was setup and stored in memory, the &lt;em&gt;initialization&lt;/em&gt;(&lt;code&gt;var x ="Variable has been called"&lt;/code&gt;) wasnt stored. This is because by default, javascript doesnt know finally what your &lt;strong&gt;variable&lt;/strong&gt; might be set to and doesnt want to make that desicion for you while storing, therefore it initially set the data of the &lt;strong&gt;variable&lt;/strong&gt; to &lt;strong&gt;undefined&lt;/strong&gt; in memory. So when the &lt;strong&gt;execution context&lt;/strong&gt; was created in the first phase, it set up a memory space for the &lt;strong&gt;variable x&lt;/strong&gt; and set the value to the special keyword '&lt;strong&gt;undefined&lt;/strong&gt;' and when executing in the second phase by processing the code from the top line by line, it sees that the &lt;strong&gt;variable x&lt;/strong&gt; is being &lt;em&gt;outputed&lt;/em&gt;(printed out) before assigned to any data and therefore retrieves the default data of '&lt;strong&gt;undefined&lt;/strong&gt;' and set the &lt;strong&gt;variable&lt;/strong&gt; to it. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  NOTE:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;All &lt;strong&gt;variables&lt;/strong&gt; in javascript are initially set to &lt;strong&gt;undefined&lt;/strong&gt; and will get &lt;em&gt;outputed&lt;/em&gt; as so except the data of the &lt;strong&gt;variable&lt;/strong&gt; has been set before  '&lt;em&gt;console.logging&lt;/em&gt;' it on your browser.&lt;/p&gt;

&lt;p&gt;Another thing to understand is that there is a difference in results between declaring a &lt;strong&gt;variable&lt;/strong&gt; without assigning anything to it and not declaring a &lt;strong&gt;variable&lt;/strong&gt; at all when trying to output it on the console of your browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;EXAMPLE 2&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CASE 1: DECLARING A VARIABLE WITHOUT ASSIGNING
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S1TgqxwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/nqesin2rbn5cfawovqm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S1TgqxwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/nqesin2rbn5cfawovqm3.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case, it can be seen in the code that the &lt;strong&gt;variable&lt;/strong&gt; has been declared but without any value assigned to it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wPiEI9bb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/cze7eqf1sq8x51h0e5vd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wPiEI9bb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/cze7eqf1sq8x51h0e5vd.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And as you would deduce from the previous explanation, the results in the console of the browser was &lt;em&gt;outputed&lt;/em&gt; as &lt;strong&gt;undefined&lt;/strong&gt; because it doesnt matter when the code is executed from top to bottom  if there is a value assigned or not as the initial value will be set to &lt;strong&gt;undefined&lt;/strong&gt; except the &lt;em&gt;initialization&lt;/em&gt; was set before &lt;em&gt;outputing&lt;/em&gt; it('&lt;em&gt;console.logging&lt;/em&gt;').&lt;/p&gt;

&lt;h3&gt;
  
  
  CASE 2 : NOT DECLARING AT ALL
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yXXJep-j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/lnr4a6mq5hkm96uv58bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yXXJep-j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/lnr4a6mq5hkm96uv58bv.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case, the &lt;strong&gt;variable&lt;/strong&gt; hasnt been declared but is being &lt;em&gt;outputed&lt;/em&gt; from the code. The results in the browser is as thus,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gUTnBHpA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zrd0l4e4o7slu945di5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gUTnBHpA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zrd0l4e4o7slu945di5b.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, from the console of the browser, we are getting an '&lt;code&gt;Uncaught ReferenceError&lt;/code&gt;' message saying &lt;strong&gt;x&lt;/strong&gt; hasnt been defined(declared or initialized).&lt;/p&gt;

&lt;p&gt;Ok but hol up now, what is the difference between the word '&lt;strong&gt;Undefined&lt;/strong&gt;' in the first case and this second case where there is an error showing that the &lt;strong&gt;variable x&lt;/strong&gt; has not been &lt;strong&gt;defined&lt;/strong&gt;. Now, there is something you need to understand about this two results.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Undefined&lt;/strong&gt; is a javascript data type, it is a special key word that means that a &lt;strong&gt;variable&lt;/strong&gt; has not been set to a value(has not been defined to mean or represent anything yet), but on the other hand , the result in case 2 is an error message that alerts you that the variable you are trying to output doesnt exists in the first place and so isnt defined to mean anything in your code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  CONCLUSION:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hoisting&lt;/strong&gt; is a default response in javascript where your &lt;strong&gt;functions&lt;/strong&gt;(including its data) and &lt;strong&gt;variables&lt;/strong&gt;(excluding its data) are stored and used up they are being called irrespective of the fact that they are below the code you use to call them up.&lt;/p&gt;

&lt;p&gt;This is my personal definition of it anyways and the way i understand it to be and hope you understand it the same way. &lt;/p&gt;

&lt;p&gt;Although,  &lt;strong&gt;hoisting&lt;/strong&gt; is javascript slick way of helping you run your code regardless of what order you write,it is best you dont rely on it or use it on your code. Rather,  the better and safe way of writing code in your &lt;strong&gt;functions&lt;/strong&gt; and &lt;strong&gt;variables&lt;/strong&gt; is &lt;em&gt;declaring&lt;/em&gt; and &lt;em&gt;initializing&lt;/em&gt; them before &lt;em&gt;outputing&lt;/em&gt; it line by line . This will help you avoid bugs and errors in your code. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a_u0Z-Rj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/j5dluv2c1o3r8thlrd5u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a_u0Z-Rj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/j5dluv2c1o3r8thlrd5u.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6t_SjfOx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fzdfnjg96l1f8w6qjba2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6t_SjfOx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fzdfnjg96l1f8w6qjba2.png" alt="Alt Text" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this entry on what hoisting is has been helpful and efficient to your understanding. Thank you for reading and keep improving!!!&lt;/p&gt;

&lt;p&gt;Follow me @ &lt;a href="https://twitter.com/Keem_Tarantino?s=09"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>USING GOOGLE FONTS</title>
      <dc:creator>Hakeem Abdul</dc:creator>
      <pubDate>Thu, 30 Jul 2020 16:38:18 +0000</pubDate>
      <link>https://dev.to/keemosty/using-google-fonts-499f</link>
      <guid>https://dev.to/keemosty/using-google-fonts-499f</guid>
      <description>&lt;h1&gt;
  
  
  HOW TO USE GOOGLE FONTS:
&lt;/h1&gt;

&lt;p&gt;Fonts are different styles of writing texts in our documents. Fonts helps in customizing our projects and makes them stand out. &lt;/p&gt;

&lt;p&gt;Custom fonts are already installed and available on systems and editors but there is still a wide variety of free fonts available on the google fonts website. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are new to using web fonts, i suggest you go through the &lt;a href="https://www.w3schools.com/css/css_font.asp" rel="noopener noreferrer"&gt;W3schools fonts tutorial&lt;/a&gt; to help you understand how to use fonts before proceeding any further.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are two ways to which a font can be used on your site.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;CDN (Content Delivery Network) LINKED&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This way a font is linked to your html document by attaching a url of the font link on the google fonts website. &lt;/p&gt;

&lt;h3&gt;
  
  
  Using Google fonts ONLINE
&lt;/h3&gt;

&lt;p&gt;*Open the site up&lt;/p&gt;

&lt;p&gt;*The display shows up with many fonts  and their previews in sentences.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkjz34ek0nmtefvdtmwt1.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkjz34ek0nmtefvdtmwt1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*You click on the plus symbol at the top right corner of the box containing the font you want to use.&lt;/p&gt;

&lt;p&gt;*A pop-up shows up, you hover over it with your cursor and it comes right up.&lt;br&gt;
Inside the pop-up, you see a link tag containing the URL source of the font you selected.&lt;/p&gt;

&lt;p&gt;*You can go ahead and copy the link and paste it right in the document of your text editor. This link should be pasted above all other link tags in the head tag that contains them.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc2obsir9xas861fs7b2g.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc2obsir9xas861fs7b2g.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can pretty much navigate through the site in a case where you decide to customize the fonts by changing the font weight in the &lt;strong&gt;customize&lt;/strong&gt; section by marking up the style option/options you choose. In doing this, the link URL actually changes and you'll need to copy the new link URL and paste it below the original first link tag.&lt;/p&gt;
&lt;/blockquote&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh3l1q2ivesmwbrj2ce9q.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh3l1q2ivesmwbrj2ce9q.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In a case you decide to use another &amp;gt;font, you deselect the previous one by &amp;gt;clicking on the minus symbol in the pop &amp;gt;up content.&lt;br&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%2Fi%2Fcizq4crqe9m6vb14ivkb.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcizq4crqe9m6vb14ivkb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ojwhu0xv29pwjj6lbll.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ojwhu0xv29pwjj6lbll.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F84b2d2r8inukftkbc6z8.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F84b2d2r8inukftkbc6z8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqpjrmbouf8cjo44js7l9.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqpjrmbouf8cjo44js7l9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16mkd8ybq0a242mcekwq.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16mkd8ybq0a242mcekwq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;p&gt;This way enables the font source to be accessed faster and loads smoothly on your web page.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;p&gt;This can only be used when there is internet access on your computer system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The link tag to which the url name of the font file is attached to should always be put at the top before all other link tags in the head tag. The reason for this is that the compiler when executing code does it line by line and therefore would first execute the top link first and then use that information to process the rest of the code in your document.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;2 &lt;strong&gt;HOSTED LOCALLY&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;This way the font zip file is downloaded from the website directly.&lt;/p&gt;

&lt;p&gt;After downloading the zip file, you can extract the contents to a folder and then saved it your projects file directory where you have your html and css file so you can access it in your document. &lt;br&gt;
-This way the link tag wont be needed as the file would be used from either your internal css file or directly from your external css stylesheet. &lt;/p&gt;

&lt;h4&gt;
  
  
  Using Google fonts OFFLINE
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;In this case after you've selected your font, instead of copying the link, you download it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*You can download the font file for offline use by clicking on the download icon the far top right of the pop-up content. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs1cddq563sutcpl2qn2e.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs1cddq563sutcpl2qn2e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*After the file has been downloaded in zip format, you extract it to a folder and place the folder in your main project directory folder.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3g0zveegp2lycdhep2rp.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3g0zveegp2lycdhep2rp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foyxaq0x1ossl73ea9azy.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foyxaq0x1ossl73ea9azy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkh8pqmj1kt3izgomj4vb.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkh8pqmj1kt3izgomj4vb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The external css style is used here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Then we use the  @font-face rule at the top of the document to access and implement the font file that was downloaded. It is used thus:&lt;/li&gt;
&lt;li&gt;Here the &lt;code&gt;src:&lt;/code&gt; is used to access the font file&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F72bxrwaxfg5du1imcjvn.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F72bxrwaxfg5du1imcjvn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;*You should take note of the directory the font file is located in order to access it properly.&lt;/p&gt;

&lt;p&gt;*Fonts generally have different file types that are used in the web. Examples are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Truetype fonts (.ttf)&lt;/li&gt;
&lt;li&gt;OpenType fonts (.otf)&lt;/li&gt;
&lt;li&gt;The Web Open Font Format (.woff)&lt;/li&gt;
&lt;li&gt;Embedded OpenType fonts (.eot)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;the extension of the font file should be included in the name e.g (fontname.ttf)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then after the name has been put in the &lt;code&gt;src:&lt;/code&gt; then we used the font family property to name the file. This name is customizable and can be named whatever we want but you'll want to take note of the name used as that will be used later in the document to access the font file.&lt;/p&gt;

&lt;h4&gt;
  
  
  USING THE FONT:
&lt;/h4&gt;

&lt;p&gt;The font file can be accessed using the font-family property and the customizable name of the font file. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbn4fni4ld8l6orjracbv.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbn4fni4ld8l6orjracbv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs5yvppj4kt2rksh3u5fi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs5yvppj4kt2rksh3u5fi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzpill7lj5jyxfugvlcfd.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzpill7lj5jyxfugvlcfd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;p&gt;This way your font file can be accessed at any time without the need for internet. It is processed offline.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;p&gt;Compared with the former online method, this method is a little bit slower when loading the fonts on your web page as the compiler when processing your code tries the retrieve the file from its source and display it on your page.&lt;/p&gt;

&lt;h1&gt;
  
  
  CONCLUSION:
&lt;/h1&gt;

&lt;p&gt;Fonts are great resources used for customizing and making our web pages personal and unique. I hope this tutorial has been able to help you navigate your way towards using fonts both online and locally on your system. I encourage you to leave your comments and suggestions kindly about this brief overview of using google fonts. KEEP LEARNING AND GOODLUCK ON YOUR JOURNEY!!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>css</category>
    </item>
    <item>
      <title>HOW TO USE CSS VARIABLES</title>
      <dc:creator>Hakeem Abdul</dc:creator>
      <pubDate>Fri, 24 Jul 2020 20:43:23 +0000</pubDate>
      <link>https://dev.to/keemosty/how-to-use-css-variables-5pg</link>
      <guid>https://dev.to/keemosty/how-to-use-css-variables-5pg</guid>
      <description>&lt;h2&gt;
  
  
  CSS VARIABLES
&lt;/h2&gt;

&lt;p&gt;Designing complex websites with a lot of styling that are often repeated can become stressful and exhausting. This is where the custom properties of css variables  comes to save the day with the use of css variables or cascading variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  WHAT ARE CSS VARIABLES?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CSS VARIABLES&lt;/strong&gt; are custom properties of CSS that enables a user to define a &lt;strong&gt;data&lt;/strong&gt;(customizable name) and assign a particular &lt;strong&gt;value&lt;/strong&gt;(property)to it for easy and faster access in a document. CSS variables are useful especially when a particular styling is repeated when designing elements.&lt;/p&gt;

&lt;p&gt;Css variables enables you to make general changes to your code without having to repeat the code over and over again.&lt;/p&gt;

&lt;p&gt;For example, if you intend to use some specific colours to style the contents of your site, then you need not write the code to do this anytime you want to do this, CSS variables enables you to define a &lt;strong&gt;'storage point'&lt;/strong&gt; for this data(colours) so that you can access and use them to style your contents easier and faster.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1xt20xjrznkzpdjvusxf.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1xt20xjrznkzpdjvusxf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuz8plpgnwycwspgn0qqw.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuz8plpgnwycwspgn0qqw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  HOW TO USE CSS VARIABLES
&lt;/h2&gt;

&lt;h4&gt;
  
  
  THE ROOT PSEUDO CLASS:
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0rnwxzin38hiavq5j1v3.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0rnwxzin38hiavq5j1v3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;root pseudo class&lt;/strong&gt; is used in the css file either internally or externally. It contains the variables used to define the style (name and the value) that will be used in styling of the intended elements.&lt;br&gt;
It is represented as thus:&lt;br&gt;
&lt;strong&gt;:root{}&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DEFINING THE VARIABLES:
&lt;/h3&gt;

&lt;p&gt;Firstly, in defining the variables which hold the name and the value of the variables, the name of the variables is customizable and can be named desirably, but needs to follow a specific syntax :&lt;br&gt;
 The name is preceeded by two dashes or hyphens like this -- &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can them proceed to name it, for example :
--header&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:&lt;br&gt;
-It can begin with a letter or an underscore&lt;br&gt;
-The name is case sensitive&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Although the variable can be named whatever you want given you follow the rules , it is always appropriate  to give your variable a name that describes its function. For example, for a variable that will be used to modify the main colour of the content of your document, it can be named '--main-text-colour'.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When concatenating(adding more than one word to the name), it should then be joined by adding a - to it, for example:&lt;br&gt;
 --header-background or&lt;br&gt;
 --header-text-background.&lt;/p&gt;

&lt;p&gt;After assigning a name to the variable, then a value should then be added to it using the normal standard of the name to the value pair, for example:&lt;/p&gt;

&lt;p&gt;:root{ --header-background: green ; &lt;/p&gt;

&lt;p&gt;--box-padding: 10px 5px; }&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t5g4tj2lhx478l7qo6d.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t5g4tj2lhx478l7qo6d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: The variable here has been defined by adding a name and a value pair to it, but has not been used to style any elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  USING THE VARIABLES TO STYLE ELEMENTS:
&lt;/h3&gt;

&lt;p&gt;Previously, we defined the variable to have a name of '--header-background' and a value of a green colour assigned to it. When using this to style your element, for example a header:&lt;/p&gt;

&lt;p&gt;-You put in the name of the property you intend styling: background,color, font properties, etc.&lt;/p&gt;

&lt;p&gt;-Then instead of assigning the custom values of that property, you substitute the defined variable containing the value you desire to use. This is done using the var() function.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw8vnd4trfe86k80d1mln.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw8vnd4trfe86k80d1mln.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ACCESSING YOUR VARIABLES USING THE VAR() FUNCTION:
&lt;/h3&gt;

&lt;p&gt;You can access your custom variables using the var() function by writing in the variable name  in the brackets.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feg8poz3ifidlrxxh7qig.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feg8poz3ifidlrxxh7qig.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an example of the variable being used to style the page that follows&lt;/p&gt;

&lt;h3&gt;
  
  
  THE CODE:
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjmrgef0cho5ujtf8lyw7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjmrgef0cho5ujtf8lyw7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  THE RESULTS:
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcr35yxe5egp5bgh9lia.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcr35yxe5egp5bgh9lia.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far, we have talked about using the :root pseudo-class to define variables used for a global scope(scope is where a variable is available in your code, a global scope in this context just simply means a general place where the use of a variable can be accessed by all the elements in your document). In a case, where you would want to define the variables and access it in a specific section or a div of the document, then the approach to doing this would be to &lt;/p&gt;

&lt;p&gt;-Define the variables in the div directly, in this case the root pseudo element would not be needed since it is not a global scope anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  THE CODE:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa3jubi5mjoaeuduz04hd.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa3jubi5mjoaeuduz04hd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  THE RESULTS:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyk0d5glq1phcmvu1lac7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyk0d5glq1phcmvu1lac7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After defining the variables in the div or section scope, you can use them to style the contents in your document either in that same scope or a new block scope of that same element.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  THE CODE:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcpaw3w42181lq679dtzl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcpaw3w42181lq679dtzl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  THE RESULT:
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmcpkeazaapg3h4kldxa2.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmcpkeazaapg3h4kldxa2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION:
&lt;/h2&gt;

&lt;p&gt;Although this is not an in depth explanation of the whole theory of &lt;strong&gt;css variables&lt;/strong&gt;, i hope this content has been able to give you an overview of the concept of css variables, how to use them basically and  the benefits of using them. Keep learning and goodluck!!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
