<?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>Forem: Waqar Mohammad</title>
    <description>The latest articles on Forem by Waqar Mohammad (@waqardm).</description>
    <link>https://forem.com/waqardm</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%2F105595%2F299b352f-8f29-4d57-b07d-c22053c749c2.jpeg</url>
      <title>Forem: Waqar Mohammad</title>
      <link>https://forem.com/waqardm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/waqardm"/>
    <language>en</language>
    <item>
      <title>CODING BYTES: PART 5 — Loops</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Fri, 14 Dec 2018 14:27:17 +0000</pubDate>
      <link>https://forem.com/waqardm/coding-bytes-part-5loops-55em</link>
      <guid>https://forem.com/waqardm/coding-bytes-part-5loops-55em</guid>
      <description>&lt;h1&gt;
  
  
  What is a Loop?
&lt;/h1&gt;

&lt;p&gt;In programming, &lt;code&gt;loops&lt;/code&gt; are used to perform repeated tasks based on a set condition. As an example, if we wanted to run a piece of code &lt;code&gt;x&lt;/code&gt; amount of times.&lt;/p&gt;

&lt;h3&gt;
  
  
  'for' Loop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// A random array with my items from my football kit&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sweater&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Shorts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Socks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ball&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;for&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;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;kit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kit&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="cm"&gt;/*
    Breakdown
    for (begin; condition; step) {
        // ... loop body ...
    }
    */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The for &lt;code&gt;loop&lt;/code&gt; is the most commonly used and it can be tricky to understand what is going on at first, but lets break it down. Firstly, look at the &lt;code&gt;syntax&lt;/code&gt; which is like an &lt;code&gt;if&lt;/code&gt; statement. You have the &lt;code&gt;for&lt;/code&gt; keyword, followed by parentheses for the conditions and the curly braces for the code that will be looped.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;const kit = ['Sweater', 'Shorts', 'Socks', 'Ball'];&lt;/code&gt;&lt;br&gt;
We are declaring an array to &lt;code&gt;loop&lt;/code&gt; over (which is just another way of saying checking through / going through).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;for&lt;/code&gt; Similar to &lt;code&gt;if&lt;/code&gt;, we are starting the &lt;code&gt;for loop&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;(let i = 0; i &amp;lt; kit.length; i++)&lt;/code&gt;&lt;br&gt;
This is where it gets a little confusing. For me, the &lt;code&gt;i&lt;/code&gt; was the part which didn't click. So we can start with that. The &lt;code&gt;i&lt;/code&gt; can be any letter or word, it is just used similar to a variable to indicate the element in question.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Looking at the example above, when we declare &lt;code&gt;i = 0&lt;/code&gt;, we are asking the &lt;code&gt;loop&lt;/code&gt; to &lt;code&gt;begin&lt;/code&gt; at point &lt;code&gt;0&lt;/code&gt; in the array, which will be the beginning (sweater). (To see why 0 is at the first item you can read this &lt;a href="https://en.wikipedia.org/wiki/Zero-based_numbering"&gt;article&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;i &amp;lt; kit.length&lt;/code&gt; is setting our &lt;code&gt;condition&lt;/code&gt; stating while &lt;code&gt;i&lt;/code&gt; is less than the &lt;code&gt;length&lt;/code&gt; of our &lt;code&gt;kit&lt;/code&gt; array, carry on &lt;code&gt;looping&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally &lt;code&gt;i++&lt;/code&gt; is the step to be taken on each &lt;code&gt;loop&lt;/code&gt;. In our example, after each &lt;code&gt;loop&lt;/code&gt; we want &lt;code&gt;i&lt;/code&gt; to increment by one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;{ console.log(kit[i]); }&lt;/code&gt;&lt;br&gt;
Within the &lt;code&gt;loop&lt;/code&gt; body, we are asking it to &lt;code&gt;console.log()&lt;/code&gt; the element on each iteration of the &lt;code&gt;loop&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specifically the &lt;code&gt;kit[i]&lt;/code&gt; is referring to each element of the array, where &lt;code&gt;kit&lt;/code&gt; is our array and &lt;code&gt;[i]&lt;/code&gt; is pointing to the element.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;😬 It may be a little crazy at first, but run through it a few times then try typing the example code out and watch the console for the output. There is also a &lt;code&gt;for/in loop&lt;/code&gt; which we will cover in the future, enough 🤯 for now.&lt;/p&gt;

&lt;h3&gt;
  
  
  'while' Loop
&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;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="k"&gt;while&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="mi"&gt;4&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="nx"&gt;log&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="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cm"&gt;/* 
    Breakdown
    while (condition){
        code
        loop
    }
    */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Just be careful with ALL loops as you could end up running an endless loop if all the elements are not input correctly.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With the &lt;code&gt;while loop&lt;/code&gt; you can see the similarities in structure and syntax. These are less common but once you've understood the &lt;code&gt;for loop&lt;/code&gt; it should make sense enough. 😉&lt;/p&gt;

&lt;p&gt;As &lt;code&gt;loops&lt;/code&gt; can be awkward to get to grips with, practice as much as possible. Why not try out the tasks below?&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Learning
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&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="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Read the code above and write down what you think it will output before coding it yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Change the &lt;code&gt;for loop&lt;/code&gt; in to a &lt;code&gt;while loop&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you get stuck drop me a tweet 😃. Good Luck and happy coding!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This will be the last part of Coding Bytes for this year. For those celebrating, have a great time, see you next year. Happy holidays!&lt;/em&gt; 🎄&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. To keep up with my coding journey come say hi 👋 on &lt;a href="https://twitter.com/lawyerscode"&gt;twitter&lt;/a&gt; or on our #devNewbie &lt;a href="https://discordapp.com/invite/mBsMP2H"&gt;Discord&lt;/a&gt; server where we have a friendly group of learners sharing their experiences.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Hey Newbies - What Do You Struggle With Most?</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Sat, 01 Dec 2018 14:59:55 +0000</pubDate>
      <link>https://forem.com/waqardm/hey-newbies---what-do-you-struggle-with-most-48ki</link>
      <guid>https://forem.com/waqardm/hey-newbies---what-do-you-struggle-with-most-48ki</guid>
      <description>

&lt;p&gt;Hey 👋 guys,&lt;/p&gt;

&lt;p&gt;Hope you're all well. Learning to code can be hard and it's inevitable we will come across challenges. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What do you/have you struggled with most? &lt;/li&gt;
&lt;li&gt;What advice would you give others?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. To keep up with my coding journey come say hi 👋 on &lt;a href="https://twitter.com/lawyerscode"&gt;twitter&lt;/a&gt; or on our #devNewbie &lt;a href="https://discordapp.com/invite/mBsMP2H"&gt;Discord&lt;/a&gt; server where we have a friendly group of learners sharing their experiences.&lt;/em&gt;&lt;/p&gt;


</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CODING BYTES: PART 4 — CONDITIONAL STATEMENTS</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Fri, 30 Nov 2018 11:25:26 +0000</pubDate>
      <link>https://forem.com/waqardm/coding-bytes-part-4conditional-statements-3dj0</link>
      <guid>https://forem.com/waqardm/coding-bytes-part-4conditional-statements-3dj0</guid>
      <description>&lt;h1&gt;
  
  
  What is a Conditional Statement?
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;Conditional statements&lt;/code&gt; come in use when one wants to perform different actions based on different input/criteria. The simplest example is a true or false question. Let's look at an example of an &lt;code&gt;if&lt;/code&gt; statement.&lt;/p&gt;

&lt;h3&gt;
  
  
  if
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Is the sun out today?&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;sun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yes the sun is shining ☀️&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Output will be: Yes the sun is shining ☀️&lt;/span&gt;

    &lt;span class="c1"&gt;// Syntax of if statement&lt;/span&gt;
    &lt;span class="cm"&gt;/*
    if(condition) {
        code that will be executed if condition is true
    }
    */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So above we are asking if the sun is out (testing the condition) and because it is true, the code between the curly braces (see example of syntax in comments above) is being executed. So what happens if the sun isn't out?&lt;/p&gt;

&lt;h3&gt;
  
  
  else
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="c1"&gt;// Is the sun out today?&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;sun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yes the sun is shining ☀️&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No, sorry!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Output will be: No, sorry!&lt;/span&gt;

    &lt;span class="c1"&gt;// Syntax of else statement&lt;/span&gt;
    &lt;span class="cm"&gt;/*
    if(condition) {
        code that will be executed if condition is true
    } else {
        execute this code if the first condition is false
    }
    */&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Our &lt;code&gt;else&lt;/code&gt; statement allows for a fallback. The &lt;code&gt;else&lt;/code&gt; keyword just adds to the &lt;code&gt;if&lt;/code&gt; statement by offering a backup if the condition isn't met.&lt;/p&gt;

&lt;h3&gt;
  
  
  else/if
&lt;/h3&gt;

&lt;p&gt;You can probably guess what the &lt;code&gt;else/if&lt;/code&gt; statement does 🤔.&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;// Is the sun out today?&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nb"&gt;sun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;rain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Yes the sun is shining ☀️&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nf"&gt;elseif &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No, sorry it is raining today 🌧️&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;It is mild&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Output will be: It is mild&lt;/span&gt;

    &lt;span class="c1"&gt;// Syntax of esle/if statement&lt;/span&gt;
    &lt;span class="cm"&gt;/*
    if(condition1) {
        code that will be executed if condition 1 is true
    } elseif (condition 2) {
        execute this code if the condition 1 is false and condition 2 is true
    } else {
        execute this code if all of the above are false
    }
    */&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;As we can see, the &lt;code&gt;else/if&lt;/code&gt; continues giving us extra options to choose from. The statements are processed from top to bottom, so there must always an &lt;code&gt;else&lt;/code&gt; when using &lt;code&gt;else/if&lt;/code&gt;. The &lt;code&gt;else&lt;/code&gt; isn't necessary for an &lt;code&gt;if&lt;/code&gt; statement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switch
&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;var&lt;/span&gt; &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;thursday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sunday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sunday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Monday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tuesday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tuesday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;wednesday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wednesday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;thursday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
       &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Thursday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;friday&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Friday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt;  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;saturday&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nx"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Saturday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Syntax of switch statement&lt;/span&gt;
    &lt;span class="cm"&gt;/*
    switch(expression) {
    case x:
        code block
        break;
    case y:
        code block
        break;
    case z:
        code block
        break;
    default:
        code block
}
    */&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;switch&lt;/code&gt; statement executes the code, and returns the matched value. The &lt;code&gt;break&lt;/code&gt; keyword stops executing the code once the match has been found as further execution is not required. In the example, a default wasn't used but it can be added if required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Differences between else/if and switch
&lt;/h3&gt;

&lt;p&gt;There are a few smaller differences between the two, which can be discussed at a later stage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Learning
&lt;/h3&gt;

&lt;p&gt;To practice, create a conditional statement for the following scenario. There are 4 greetings for the day depending on the time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Between 00.00 and 12.00 the greeting will be 'Good Morning'&lt;/li&gt;
&lt;li&gt;Between 12.01 and 17.00 the greeting will be 'Good Day'&lt;/li&gt;
&lt;li&gt;Between 17.00 and 20.00 the greeting will be 'Good Evening'&lt;/li&gt;
&lt;li&gt;Between 20.01 and 23.59 the greeting will be 'Good Evening'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use &lt;code&gt;console.log()&lt;/code&gt; for outputting your results or try &lt;a href="https://codepen.io" rel="noopener noreferrer"&gt;CodePen&lt;/a&gt; to play around with better syntax highlighting.&lt;/p&gt;

&lt;p&gt;If you need get stuck drop me a tweet 😃. Good Luck and happy coding!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. To keep up with my coding journey come say hi 👋 on &lt;a href="https://twitter.com/lawyerscode" rel="noopener noreferrer"&gt;twitter&lt;/a&gt; or on our #devNewbie &lt;a href="https://discordapp.com/invite/mBsMP2H" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; server where we have a friendly group of learners sharing their experiences.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Productivity Hacks</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Mon, 26 Nov 2018 19:36:15 +0000</pubDate>
      <link>https://forem.com/waqardm/coding-bytes-part-3-productivity-hacks-3hek</link>
      <guid>https://forem.com/waqardm/coding-bytes-part-3-productivity-hacks-3hek</guid>
      <description>&lt;p&gt;Hey Guys 👋🏽,&lt;/p&gt;

&lt;p&gt;Hope everyone is OK. When learning (reading a lot) i've found myself getting distracted easily so today I thought to try the Pomodoro technique and i'm happy to say I saw some great results!&lt;/p&gt;

&lt;p&gt;It got me thinking, what other hacks work you guys?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. To keep up with my coding journey come say hi 👋 on &lt;a href="https://twitter.com/lawyerscode" rel="noopener noreferrer"&gt;twitter&lt;/a&gt; or on our #devNewbie &lt;a href="https://discordapp.com/invite/mBsMP2H" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; server where we have a friendly group of learners sharing their experiences.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learning Resources for Dev Newbies</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Tue, 20 Nov 2018 18:49:31 +0000</pubDate>
      <link>https://forem.com/waqardm/learning-resources-for-dev-newbies-52e</link>
      <guid>https://forem.com/waqardm/learning-resources-for-dev-newbies-52e</guid>
      <description>&lt;h1&gt;
  
  
  Dev Newbie Learning Resources
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Self-learning coding can be difficult as well as confusing. During the course of my learning I have been collating resources but never had single list so here goes.&lt;/li&gt;
&lt;li&gt;If you feel I have missed anything, please complete a pull-request. I will be updating it as and when required too.&lt;/li&gt;
&lt;li&gt;When learning, it is too easy to get confused by the noise, just try to learn the basics and the rest will follow. See the roadmap below to help you focus.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ℹ️ Apologies in advance if it is Javascript-heavy as it is what I have been working with most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Roadmap 🏎️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/kamranahmedse/developer-roadmap" rel="noopener noreferrer"&gt;RoadMap&lt;/a&gt; - Follow this and you can't go wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Learning 🤹
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://freecodecamp.org" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; - Without a doubt, the best learning resource for me personally&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.udemy.com" rel="noopener noreferrer"&gt;Udemy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lynda.com" rel="noopener noreferrer"&gt;Lynda&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Books 📚
&lt;/h2&gt;

&lt;p&gt;Very well rated and easy-to-understand books.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/getify/You-Dont-Know-JS" rel="noopener noreferrer"&gt;You Don't Know Javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://eloquentjavascript.net/" rel="noopener noreferrer"&gt;Eloquent&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Documentation / Guides 📂
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://css-tricks.com/" rel="noopener noreferrer"&gt;CSS Tricks&lt;/a&gt; - Extremely useful CSS guide, I normally use when stuck&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tympanus.net/codrops/css_reference/" rel="noopener noreferrer"&gt;Co Drops&lt;/a&gt; - Another great CSS Resource&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JS/HTML/Jquery&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/" rel="noopener noreferrer"&gt;W3Schools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/" rel="noopener noreferrer"&gt;Mozilla Developer Network&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://php.net/manual/en/index.php" rel="noopener noreferrer"&gt;PHP Manual&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Blog Posts 💻
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://lawyerscode.co.uk/blog" rel="noopener noreferrer"&gt;Lawyers Code&lt;/a&gt; (My personal attempt to solidfy my learning and hopefully pass on some knowledge)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@_ericelliott/latest" rel="noopener noreferrer"&gt;Eric Elliot&lt;/a&gt; - Extremely knowledgeable and informative, but on the advanced side.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp Medium Publication&lt;/a&gt; - Various authors with some great content&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/" rel="noopener noreferrer"&gt;Smashing Magazine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/" rel="noopener noreferrer"&gt;CSS Tricks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zen-of-programming.com/" rel="noopener noreferrer"&gt;Zen of Programming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Video Tutorials 📽️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/user/TechGuyWeb" rel="noopener noreferrer"&gt;Traversy Media&lt;/a&gt; - Various languages and frameworks covered&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/channel/UC6kwT7-jjZHHF1s7vCfg2CA" rel="noopener noreferrer"&gt;DevMarketer&lt;/a&gt; - Mainly PHP/Laravel but also covers some great concepts around git&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://laracasts.com" rel="noopener noreferrer"&gt;Laracasts&lt;/a&gt; - Geared towards Laravel, but other frameworks/langs are covered as well as general principles&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wesbos.com" rel="noopener noreferrer"&gt;Wes Bos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Useful Twitter Accounts 🐦
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/lawyerscode" rel="noopener noreferrer"&gt;lawyerscode&lt;/a&gt; - Me 😃&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/js_tut" rel="noopener noreferrer"&gt;Javascript Teacher&lt;/a&gt; - Easy to understand tutorials, despite the name CSS and other useful information is shared.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/SaraSoueidan" rel="noopener noreferrer"&gt;Sara Soudein&lt;/a&gt; - Great for css and design related detail&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ASpittel" rel="noopener noreferrer"&gt;Ali Spittel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/benjaminspak" rel="noopener noreferrer"&gt;Benjamin Spak&lt;/a&gt; - Positive, engaging content for devs&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/getify" rel="noopener noreferrer"&gt;Getify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/venikunche" rel="noopener noreferrer"&gt;Veni Kunche&lt;/a&gt; - Provides great info on scholarships for conferences&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/BatsouElef" rel="noopener noreferrer"&gt;Eleftheria Batsou&lt;/a&gt; - Great doses of energy and determination, especially around the #100DaysOfCode Challenge&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Communities 🏢
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/"&gt;DEV Community&lt;/a&gt; - One of the best dev communities I have come across&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://discord.gg/n7JNnK2" rel="noopener noreferrer"&gt;Dev Newbies Discord&lt;/a&gt; - General chit chat and helpful for dev newbies&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.100daysofcode.com/" rel="noopener noreferrer"&gt;#100DaysOfCode&lt;/a&gt; - Excellent community for learning as well as gaining momentum in your journey&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codenewbie.org/" rel="noopener noreferrer"&gt;Code Newbie&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Help! 🆘
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;For When you are stuck&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/" rel="noopener noreferrer"&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://google.com" rel="noopener noreferrer"&gt;Google&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>resources</category>
    </item>
    <item>
      <title>I am a Law grad working towards my first development role. Ask Me Anything!</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Tue, 20 Nov 2018 09:37:53 +0000</pubDate>
      <link>https://forem.com/waqardm/i-am-a-law-grad-working-towards-my-first-development-role-ask-me-anything-1a93</link>
      <guid>https://forem.com/waqardm/i-am-a-law-grad-working-towards-my-first-development-role-ask-me-anything-1a93</guid>
      <description></description>
      <category>ama</category>
    </item>
    <item>
      <title>Coding Bytes Part 3: Javascript Functions</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Tue, 20 Nov 2018 08:24:47 +0000</pubDate>
      <link>https://forem.com/waqardm/coding-bytes-part-3-javascript-functions-20j5</link>
      <guid>https://forem.com/waqardm/coding-bytes-part-3-javascript-functions-20j5</guid>
      <description>&lt;p&gt;&lt;em&gt;This is part 2 in the Coding Bytes series, earlier parts are listed below:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://lawyerscode.co.uk/blog/coding-bytes-1" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;&lt;a href="https://lawyerscode.co.uk/blog/coding-bytes-2" rel="noopener noreferrer"&gt;Part 2&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  What is a Function?
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;function&lt;/code&gt; is in fact an &lt;code&gt;object&lt;/code&gt; designed to perform a specific task, often on a repetitive basis.&lt;/p&gt;
&lt;h3&gt;
  
  
  Defining a Function
&lt;/h3&gt;

&lt;p&gt;There are a few ways of defining a &lt;code&gt;function&lt;/code&gt;, but we will focus on the most basic, so &lt;code&gt;arrow functions/ ES6 functions&lt;/code&gt; will be overlooked for now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;nameOfFunction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As seen in the example above, the &lt;code&gt;function&lt;/code&gt; keyword is used to define a &lt;code&gt;function&lt;/code&gt;. The keyword is followed by a name of your choosing but it is normally good practice to describe what the &lt;code&gt;function&lt;/code&gt; does - more on this below.&lt;/p&gt;

&lt;p&gt;After naming the &lt;code&gt;function&lt;/code&gt; we have the &lt;code&gt;parameters&lt;/code&gt; in &lt;code&gt;parentheses ( )&lt;/code&gt; followed by our statement in &lt;code&gt;curly braces { }&lt;/code&gt;. You can have up to 255 &lt;code&gt;parameters&lt;/code&gt; defined separated by a comma. &lt;code&gt;Parameters&lt;/code&gt; are similar to placeholders wherein the &lt;code&gt;function&lt;/code&gt; knows to look for these to perform its intended use. You may encounter the term &lt;code&gt;arguments&lt;/code&gt; used inter-changeably, but there is a slight difference, which is better explained in an example.&lt;/p&gt;

&lt;p&gt;ℹ️ &lt;em&gt;If you are using Chrome, you can try following along in the &lt;a href="https://www.youtube.com/watch?v=PIxpbreS3eU&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;console&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Example
&lt;/h5&gt;

&lt;p&gt;In our example, my friend is a carpet fitter who needs to work out the &lt;code&gt;area&lt;/code&gt; of a room so he knows how much carpet is required. We know that &lt;code&gt;area = length x width&lt;/code&gt;, so how do we put this in a &lt;code&gt;function&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;function&lt;/span&gt; &lt;span class="nf"&gt;area&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example, our &lt;code&gt;function&lt;/code&gt; is named area and the &lt;code&gt;parameters&lt;/code&gt; are &lt;code&gt;length, width&lt;/code&gt;. You can see a &lt;code&gt;return&lt;/code&gt; statement which stops the execution of the function and tells the function what we are expecting to see as a response. In the statement, we are asking for the &lt;code&gt;length&lt;/code&gt; and &lt;code&gt;width&lt;/code&gt; to be multiplied. In short, the task of our function is to multiply the &lt;code&gt;parameters&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Invoking a Function
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Invoking&lt;/code&gt; a &lt;code&gt;function&lt;/code&gt; is just a fancy way of 'calling' a &lt;code&gt;function&lt;/code&gt;. To call a &lt;code&gt;function&lt;/code&gt; we just need to reference it by its name followed by parentheses. We can refer back to our example above and &lt;code&gt;invoke&lt;/code&gt; the area &lt;code&gt;function&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="nf"&gt;area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, we call the &lt;code&gt;area&lt;/code&gt; function but you will notice the &lt;code&gt;10,5&lt;/code&gt; in the &lt;code&gt;()&lt;/code&gt;. The two numbers represent the &lt;code&gt;length, width&lt;/code&gt; we mentioned earlier, otherwise known as &lt;code&gt;parameters&lt;/code&gt;. But here, because they are data being given to the function - we call them &lt;code&gt;arguments&lt;/code&gt;. Hopefully it is easier to see the difference between the two now 😃 .&lt;/p&gt;

&lt;p&gt;All we are saying in the &lt;code&gt;invocation&lt;/code&gt; above is, run the &lt;code&gt;area&lt;/code&gt; &lt;code&gt;function&lt;/code&gt; and use &lt;code&gt;10,5&lt;/code&gt; as &lt;code&gt;arguments&lt;/code&gt;. As we know our &lt;code&gt;function&lt;/code&gt; is set to multiply the two &lt;code&gt;arguments&lt;/code&gt;, resulting in the output of 50. Congratulations 🎉 we created and &lt;code&gt;invoked&lt;/code&gt; our first &lt;code&gt;function&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Learning
&lt;/h3&gt;

&lt;p&gt;This was just a very basic &lt;code&gt;function&lt;/code&gt;, but you can do so much more! To practice further, think about where a &lt;code&gt;function&lt;/code&gt; can come in handy and try to create one. There is another example below, try to understand what it may do before copying it in to your &lt;code&gt;console&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;function&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;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;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; is &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; years old.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to research what &lt;code&gt;console.log()&lt;/code&gt; does, and remember strings are wrapped with &lt;code&gt;" "&lt;/code&gt;. Good Luck!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. To keep up with my coding journey come say hi 👋 on &lt;a href="https://twitter.com/lawyerscode" rel="noopener noreferrer"&gt;twitter&lt;/a&gt; or on our #devNewbie &lt;a href="https://discordapp.com/invite/mBsMP2H" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; server where we have a friendly group of learners sharing their experiences.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>To All Ye Naysayers - It's OK, I Know My Value 😃</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Sun, 18 Nov 2018 21:47:33 +0000</pubDate>
      <link>https://forem.com/waqardm/to-all-ye-naysayers---its-ok-i-know-my-value--3fom</link>
      <guid>https://forem.com/waqardm/to-all-ye-naysayers---its-ok-i-know-my-value--3fom</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wn3k3p75ywneqq233mp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wn3k3p75ywneqq233mp.png" alt="certificate" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I managed to bag my second &lt;a href="https://freecodecamp.org" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; (FCC) certification for Javascript Algorithms and Data Structures and shared it to my small following on twitter. Before I knew it a fair few people had seen it due to Quincy (FCC founder) responding to the tweet.&lt;/p&gt;

&lt;p&gt;I wasn't surprised by the amount of nice comments and congratulatory messages received as this community is awesome. I did manage to attract a couple of tweets which weren't as, well, congratulatory. They focused on the fact that the certificates didn't have any real value - meh 😒. Whilst what they tweeted didn't really bother me, I thought it important to share my responses so other people who come across the same attitude can see things in a better perspective.&lt;/p&gt;

&lt;h5&gt;
  
  
  Tweet 1
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0ktg0nrx31m9xo6kfrx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0ktg0nrx31m9xo6kfrx.png" alt="Tweet 1" width="600" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Tweet 2
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbzviza6v5df78utlx3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbzviza6v5df78utlx3t.png" alt="Tweet 2" width="627" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, technically, the certificates don't hold value, but then neither does our university degree right? The value these items hold are the blood, sweat, and tears we put in. The hundreds of hours of effort and time. The sacrifice. And the knowledge gained.&lt;/p&gt;

&lt;p&gt;So if anyone tries to downplay your achievements - just let them know. But more importantly, make sure you know exactly what the each milestone you achieve means. And celebrate like a boss 👑.&lt;/p&gt;

&lt;p&gt;P.S if you want to be a part of a support newbie community, come join us on &lt;a href="https://discord.gg/n7JNnK2" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading. If you want to join along in my coding journey come say hi 👋 on twitter. I can be found &lt;a href="https://twitter.com/lawyerscode" rel="noopener noreferrer"&gt;@lawyerscode&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Talking About Burnout</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Thu, 08 Nov 2018 10:06:50 +0000</pubDate>
      <link>https://forem.com/waqardm/talking-about-burnout-31d5</link>
      <guid>https://forem.com/waqardm/talking-about-burnout-31d5</guid>
      <description>&lt;p&gt;👋 Guys,&lt;/p&gt;

&lt;p&gt;It seems burnout is an important element of being a dev. I’ve seen a few threads on social media about it with newbies and seasoned professionals going through one or multiple occurrences. As a learner, I feel I have experienced it on occasion too. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Do you think it is discussed as much as it should be?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How does one reduce the risk and affect of it?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do &lt;em&gt;you&lt;/em&gt; deal with it if you have experienced it?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>Favourite VSCode Plug-ins</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Wed, 07 Nov 2018 17:08:08 +0000</pubDate>
      <link>https://forem.com/waqardm/favourite-vscode-plug-ins--j6k</link>
      <guid>https://forem.com/waqardm/favourite-vscode-plug-ins--j6k</guid>
      <description>&lt;p&gt;👋 guys,&lt;/p&gt;

&lt;p&gt;I know emmett is avail on other Code editors too but it’s one that I like. Other than that I just have one that shows icons based on the file extension and autocomplete. &lt;/p&gt;

&lt;p&gt;For those that use VS Code, what are your fav plug ins?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Code Newbies - Lets Connect</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Mon, 05 Nov 2018 19:32:36 +0000</pubDate>
      <link>https://forem.com/waqardm/code-newbies---lets-connect-1g1o</link>
      <guid>https://forem.com/waqardm/code-newbies---lets-connect-1g1o</guid>
      <description>&lt;p&gt;Hey guys 👋,&lt;/p&gt;

&lt;p&gt;Have been in this community for a few weeks now and it is 😎. Everyone seems so friendly and the content is amazing too. So much to learn!&lt;/p&gt;

&lt;p&gt;I’m just wondering how many newbies / learners there are on here. It would be great to connect and grow together. Come say 👋. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Coding Bytes: Part 2 — Data Types, Operators &amp; Syntax</title>
      <dc:creator>Waqar Mohammad</dc:creator>
      <pubDate>Fri, 02 Nov 2018 18:09:36 +0000</pubDate>
      <link>https://forem.com/waqardm/coding-bytes-part-2-data-types-operators--syntax-4m63</link>
      <guid>https://forem.com/waqardm/coding-bytes-part-2-data-types-operators--syntax-4m63</guid>
      <description>&lt;p&gt;&lt;em&gt;This is part 2 in the Coding Bytes series, earlier parts are listed below:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://dev.to/waqardm/coding-bytes-part-1intro--data-types-2nbc"&gt;Part One&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data Types Continued...
&lt;/h2&gt;

&lt;p&gt;In the first part we didn't get to finish of all of the data types. This was intentional as the post was getting a little longer than I wanted, and secondly, during the course of the series some things will be omitted so as to keep things as simple as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objects&lt;/strong&gt;&lt;br&gt;
We have covered &lt;code&gt;arrays&lt;/code&gt; previously, and similar to arrays are &lt;code&gt;objects&lt;/code&gt;. An example of an &lt;code&gt;object&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;var&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Waqar&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mohammad&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;eyeColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;brown&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;As you can see, &lt;code&gt;arrays&lt;/code&gt; and &lt;code&gt;objects&lt;/code&gt; are similar. As we move forward in the series we will go in detail about the difference between &lt;code&gt;arrays&lt;/code&gt;, &lt;code&gt;multi-dimensional arrays&lt;/code&gt; and &lt;code&gt;objects&lt;/code&gt;. For now, we just need to know objects can be used to store data that has descriptive properties, such as in the example where I am the object in question. See the table below for a representation of the 'me' &lt;code&gt;object&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Property Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;firstName&lt;/td&gt;
&lt;td&gt;Waqar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lastName&lt;/td&gt;
&lt;td&gt;Mohammad&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Age&lt;/td&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;eyeColour&lt;/td&gt;
&lt;td&gt;brown&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Boolean (again)&lt;/strong&gt;&lt;br&gt;
We covered that boolean is a &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; value which can also be represented with '1' or '0'. In actual fact there are a few more '&lt;em&gt;falsy&lt;/em&gt;' values. For now, we won't go into details but it's important that we skim over them.&lt;/p&gt;
&lt;h5&gt;
  
  
  Falsy Values
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;null&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;undefined&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;""&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NaN&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Operators
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Arithmetic Operators&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Operators&lt;/code&gt; are the same as you will have seen in math(s) class during school and may use daily. These are known as &lt;code&gt;arithmetic operators&lt;/code&gt;. The table below shows how they work.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please note: &lt;code&gt;x = 10&lt;/code&gt; and &lt;code&gt;y = 3&lt;/code&gt; in examples.&lt;/em&gt; &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Addition&lt;/td&gt;
&lt;td&gt;&lt;code&gt;+&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;x &lt;code&gt;+&lt;/code&gt; y = 13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subtraction&lt;/td&gt;
&lt;td&gt;&lt;code&gt;-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;x &lt;code&gt;-&lt;/code&gt; y = 7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multiplication&lt;/td&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;x &lt;code&gt;*&lt;/code&gt; y = 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Division&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;x &lt;code&gt;/&lt;/code&gt; y = 3.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modulas (remainder of a division)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;%&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;x &lt;code&gt;%&lt;/code&gt; 3 = 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Increment&lt;/td&gt;
&lt;td&gt;&lt;code&gt;++&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;var z = x&lt;code&gt;++&lt;/code&gt;. Result &lt;code&gt;z = 11&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decrement&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;var z = x&lt;code&gt;--&lt;/code&gt;. Result &lt;code&gt;z = 9&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;modulas&lt;/code&gt; operator may be a little confusing, but all we are doing in the example above is dividing &lt;code&gt;x&lt;/code&gt; by 3 and asking the computer to carry on dividing equally as long as possible, then give us the remainder which here is 1. So instead of the &lt;code&gt;3.33&lt;/code&gt; we get when we do the standard division of &lt;code&gt;10 / 3&lt;/code&gt;, we are getting a remainder of &lt;code&gt;1&lt;/code&gt; because &lt;code&gt;3&lt;/code&gt; can be divided in to 10 a total 3 times, but on the fourth attempt, there is only &lt;code&gt;1&lt;/code&gt; left - which is what the &lt;code&gt;modulas operator&lt;/code&gt; gives us. I know it can be confusing at first 😕! But you will get used to it, I promise.&lt;/p&gt;

&lt;p&gt;Another thing to note is that the &lt;code&gt;++&lt;/code&gt; and &lt;code&gt;--&lt;/code&gt; operators can come before or after the value in question e.g. &lt;code&gt;++y&lt;/code&gt; or &lt;code&gt;y++&lt;/code&gt;, and the positioning is important which we will review at a later stage.&lt;/p&gt;

&lt;p&gt;Lastly, there are other operators which we will review as the series proceeds.&lt;/p&gt;
&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Syntax&lt;/code&gt; in Javascript (and other languages) are a set of rules, such as we have in spoken languages like English.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keywords&lt;/strong&gt;&lt;br&gt;
We have come across the &lt;code&gt;var&lt;/code&gt; keyword before. Keywords are reserved for certain actions where &lt;code&gt;var&lt;/code&gt; is used to assign a variable. It must be noted &lt;code&gt;VAR&lt;/code&gt; or &lt;code&gt;Var&lt;/code&gt; cannot be used instead of &lt;code&gt;var&lt;/code&gt; as Javascript is case sensitive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Semicolon&lt;/strong&gt;&lt;br&gt;
A semicolon or &lt;code&gt;;&lt;/code&gt; is used to end a statement, like a full-stop or period &lt;code&gt;.&lt;/code&gt; would end a sentence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;br&gt;
We will often need to comment in code, so starting with two slashes &lt;code&gt;//&lt;/code&gt; will let ensure any text/data after them will be ignored. An example is shown below. Note the multiline comment syntax too.&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;// this is an example of a comment.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/*
This is a
multiline comment
*/&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Identifiers&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Identifiers&lt;/code&gt; are essentially names. The rule in Javascript is that a first character of an identifier must start with a &lt;code&gt;letter&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, or a &lt;code&gt;$&lt;/code&gt; sign. It cannot start with a &lt;code&gt;number&lt;/code&gt;. A fun way of learning / testing if your identifier is valid can be seen &lt;a href="https://mothereff.in/js-variables"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Case&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Camel Case
&lt;/h5&gt;

&lt;p&gt;In programming we will come across a few types of case. We have come across &lt;code&gt;camel case&lt;/code&gt; in the &lt;code&gt;object&lt;/code&gt; example above where &lt;code&gt;firstName&lt;/code&gt; was the &lt;code&gt;property&lt;/code&gt;. In &lt;code&gt;camel case&lt;/code&gt; the words have no space between them and the first letter of each word, excluding the first word, are capitalised.&lt;/p&gt;

&lt;h5&gt;
  
  
  Pascal Case
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;Pascal case&lt;/code&gt; is exactly like &lt;code&gt;camel case&lt;/code&gt;, the only difference being the first word has a capital letter too. So instead of &lt;code&gt;firstName&lt;/code&gt; as it would be in &lt;code&gt;camel case&lt;/code&gt;, here it would be &lt;code&gt;FirstName&lt;/code&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Others
&lt;/h5&gt;

&lt;p&gt;Other examples are &lt;code&gt;underscore&lt;/code&gt; where each word is separated by an underscore, &lt;code&gt;first_name&lt;/code&gt;. And &lt;code&gt;hyphen&lt;/code&gt;, &lt;code&gt;first-name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Whitespace and Line Breaks&lt;/strong&gt;&lt;br&gt;
Javascript ignores any spaces that you put in between code, unless they are specified in something like a &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading. If you want to join along in my coding journey come say hi 👋 on twitter. I can be found &lt;a href="https://twitter.com/lawyerscode"&gt;@lawyerscode&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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