<?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: jamilu jibrilla</title>
    <description>The latest articles on DEV Community by jamilu jibrilla (@jamil).</description>
    <link>https://dev.to/jamil</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%2F524966%2F8f4684d2-204d-451a-9289-3335505a6e45.png</url>
      <title>DEV Community: jamilu jibrilla</title>
      <link>https://dev.to/jamil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jamil"/>
    <language>en</language>
    <item>
      <title>My AltSchool journey</title>
      <dc:creator>jamilu jibrilla</dc:creator>
      <pubDate>Tue, 28 Jun 2022 00:17:00 +0000</pubDate>
      <link>https://dev.to/jamil/my-altschool-journey-3daf</link>
      <guid>https://dev.to/jamil/my-altschool-journey-3daf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Month 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During my first week, I learned how to use the calendar and email app effectively and how to set up events using a google calendar.&lt;/p&gt;

&lt;p&gt;I also learned some of the best practices to consider when writing  emails (adding signatures, text formatting, how to archive or label your emails for easy identification etc...) and using Carbon copy (cc) and Blind carbon copy (bcc) when sending emails.&lt;/p&gt;

&lt;p&gt;I was then introduced to the learning management system (LMS) where i watched videos on how to navigate and make the best out of the LMS. There we had a walkthrough of what we’ll be doing throughout the year.&lt;/p&gt;

&lt;p&gt;Below are some very important points to keep in mind as we progress on our journey to become world class software engineers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We’ll be grouped into learning circles during our second month at the school, our learning circles will serve as an accountability group where we help and motivate each other as we progress. Leads and co-lead will be randomly assigned and the circles will be rotated after some time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each circle is expected to have a group study session at least once a week.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Classes will be held twice a week to breakdown the concepts that were taught on the LMS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Town hall meetings will be held once a month and attendance is compulsory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Students progress will be tracked, a document with the ratings (green, yellow and red) will be shared to show your progress, if your rating is red you have three weeks to work towards having a yellow/green else you will be placed on probation. Been on probation for three weeks will lead to elimination from the program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exams will be written as coding exercises at the end of each month, which is 40% of your final grade, weekly assessment, quiz and attendance is 60%.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In the course of the second week&lt;/strong&gt;, I learned the basics of computer science, below are notes from my understanding of the concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is computer science?&lt;/strong&gt;&lt;br&gt;
Computer science is a broad field, it involves all aspects of computing, ranging from problem solving to the process that goes into solving those problems. Computer science is all about problem solving, it teaches students to create new technologies and not just learn how to use them. &lt;/p&gt;

&lt;p&gt;In a more technical term, it refers to the study of computers, its principles, hardware and software designs and how they impact society at large.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some of the fields of computer science include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Artificial intelligence (the design of systems which can perform computations without human control)&lt;/li&gt;
&lt;li&gt;UI/UX&lt;/li&gt;
&lt;li&gt;Data science etc…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SOFTWARE ENGINEERING:&lt;/strong&gt; is a branch of computer science in which the principles of computer science are applied in order to develop softwares.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what are software and hardware:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hardware from the definition we are used to, refers to those components of a computer system that you can see, touch and interact with.&lt;/p&gt;

&lt;p&gt;while&lt;/p&gt;

&lt;p&gt;Software are the components of the computer that you cannot physically touch, however you can interact with them. These components perform computations or actions by following a series or sets of commands given to them. Example includes: Operating systems, facebook, Adobe photoshop etc…&lt;/p&gt;

&lt;p&gt;Software is classified into &lt;strong&gt;system software&lt;/strong&gt; and &lt;strong&gt;application software&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These two works hand in hand in order for a computer to function, without system software however, application software cannot be run successfully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System software&lt;/strong&gt; is the software that acts as an intermediary between the computer and user, this software is programmed to access and control how the computer hardware works.&lt;br&gt;
An example of system software is your Operating system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application software&lt;/strong&gt; helps users perform specific operations ranging from sending a message, playing a video etc, depending on what the application is programed to do, the application software aids the user to perform tasks.&lt;/p&gt;

&lt;p&gt;These are some of the major concepts i learned during the second week.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;During my third Week&lt;/strong&gt;, after learning the basics of computer science, i was then introduced to some of the basics concepts of programming, below are some of the concepts that were taught.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is programming?&lt;/strong&gt;&lt;br&gt;
  Programming is the process of telling a computer what to do and getting it to solve problems. it is the act of giving well structured instructions to a computer to run or execute&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming languages&lt;/strong&gt;&lt;br&gt;
  Just like human language, we can use different languages to give instructions to a computer, however a computer only understand one language called &lt;u&gt;machine language&lt;/u&gt;, this language is made of bits(binary digits) which are zero's and one's.&lt;/p&gt;

&lt;p&gt;There are two types of computer language&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High level language&lt;/strong&gt;:- This languages are more understandable and human readable, it is translated by translators (compilers and interpreters) to machine language which is the language a computer can understand directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low Level Language:-&lt;/strong&gt;  is the language that a computer can directly understand, the processor is able to run low level languages without using translators, and that makes low level programming faster, however it is not human readable and easy to understand like other high level languages. &lt;/p&gt;

&lt;p&gt;Low level languages are also subdivided into: &lt;strong&gt;Machine and Assembly language.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine language&lt;/strong&gt; is the language a computer can understand without having to use a translator. These languages are written in bits (0’s and 1‘s) and hexadecimals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assembly language&lt;/strong&gt; is also a low level language but it is designed for specific processors, this language represents instructions in a bit more human readable and understandable way. Assembly language uses an assembler to convert codes to machine language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DATA AND INFORMATION:&lt;/strong&gt;&lt;br&gt;
  Data’s are group values that does not have meaning, this values can be a letter, group of letters, numbers etc. Example of values can be a list of dates, names of people, adresses etc&lt;/p&gt;

&lt;p&gt;Data’s are of 2 types:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analog &amp;amp; Digital:&lt;/strong&gt; Analog data is data that can be represented physically eg sound, while digital data is used to model other types of physical data using machine dependent language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Information&lt;/strong&gt; is the result gotten when data's are processed, this results can then be use to make decisions.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BITS &amp;amp; BYTES&lt;/strong&gt;&lt;br&gt;
Bits which means binary digits are represented as 0 and 1.&lt;br&gt;
Because using just 0's and 1;s can be very limiting, this 0's and 1's are grouped together to represent any data or information in a computer system.&lt;/p&gt;

&lt;p&gt;A group of 8bits is called a byte, and a nibble is a group of 4 bits.&lt;/p&gt;

&lt;p&gt;Bits is denoted with a small letter b.&lt;/p&gt;

&lt;p&gt;Bytes is denoted with a capital letter B.&lt;/p&gt;

&lt;p&gt;1024B = 1kB&lt;br&gt;
1024kB = 1mB&lt;br&gt;
1024mB = 1gB&lt;/p&gt;

&lt;p&gt;Bits are mostly used in measuring/describing network speed, while bytes are used in measuring the size of data on a computer.&lt;/p&gt;

&lt;p&gt;In the example below, you can see how to measure the time taken to finish downloading a 200mB of file with a network speed of 200mb/s:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1bit = 0.125 (since 8bit = 1byte, 1bit = ⅛ = 0.125)

//Converting 200megabits to a megabyte first

1     =  0.125
200   =  x

X = 200 * 0.125 = 25mB

T = 200/25
T = 8s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So 200mB / 25mB is the time it would take to complete the download&lt;br&gt;
T = 8secs, (it will take 8sec to download a 200mB file size with a network speed of 200mb, well except you are using Glo lol)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VARIABLES &amp;amp; DATA TYPES&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variable is a way labeling data, a variable is like a container for holding a value, this value can be anything from a string, number, array etc.&lt;/p&gt;

&lt;p&gt;Having value stored in a variable will save you from having to write it over and over again and the stress to remember it, imaging having to remember a value: 98765434567, you can just give it a name: let x = 98765434567 and each time you need to use it, you call the variable with the name x.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data types&lt;/strong&gt; specifies which type of value a variable holds, some of data types we have are: string, numbers, Boolean, arrays etc. Defining a data type creates or gives you the ability to use specific set of operations on that data, for example using subtraction, multiplication, division on numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DATA STRUCTURES&lt;/strong&gt;&lt;br&gt;
  Data structures is a way of organizing data in a specific way to be able to access and use them efficiently. We have linear and non linear data structures. Some examples of data structures includes:&lt;/p&gt;

&lt;p&gt;Linked List : is a linear data structure where items are placed in such a way that they are connected to each other, gaining access to an item means having access to the item before it, data cannot be randomly accessed from anywhere in a linear data structure but rather moving step by step from the first data to the next and eventually the last. &lt;/p&gt;

&lt;p&gt;Each item in a linked list is called a node, and the node contains a pointer which points to the next node.&lt;/p&gt;

&lt;p&gt;Hash Table: Hash table is a non-linear data structure, here data's are stored in a key value pair, each value has a unique key as integer in a hash table. This integers are created by hash functions, so no key is ever the same, this hash functions are used in cryptography, security etc…&lt;/p&gt;

&lt;p&gt;Other examples of data structures include, Arrays, objects, stack, queue etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONTROL FLOW&lt;/strong&gt;&lt;br&gt;
  This is the order in which a program runs, by default it is sequential(top to bottom)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sequential: starts from the top in the order in whch it was written&lt;/li&gt;
&lt;li&gt;Conditional: this is using a bunch of if else statements&lt;/li&gt;
&lt;li&gt;Loops: running an operation over and over again untill a condition is met.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is recursion?&lt;/strong&gt;&lt;br&gt;
 An algorithm/function that calls itself until a base condition is met, most problem solved with recursion can also be solved with loops and recursion has no performance benefit over loops but it make our code look clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BIG O NOTATION&lt;/strong&gt;&lt;br&gt;
Big o is the measure of how well an algorithm can perform, it is also known as time complexity which is the measure of how long it takes an algorithm to complete running, but big o doesn’t just measure time taken, it  analyses the efficiency and scalability of an algorithm and how much time and space the algorithm consumes (Time and space complexity).&lt;/p&gt;

&lt;p&gt;Big o measures the worst case-scenario of an algorithm.&lt;/p&gt;

&lt;p&gt;Some common big o complexities are: &lt;br&gt;
&lt;strong&gt;0(1):&lt;/strong&gt; This means constant time, no matter the size of your input the algorithm will use the same of amount of time to complete running. Example is when we try to access an item in an array, no matter the size of your array or what array index you are getting the item from, the algorithm is performing one operation and takes up the same time always.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;o(n):&lt;/strong&gt; in this case, time taken to complete an operation increase with respect to the size of the input given, an example is reading a book with n pages, or looping through an array to get the  last item, if the array length is 4 it takes less time to complete than when the array length is 400000.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;o(log-n):&lt;/strong&gt; in this case, as the input increases the time taken to complete the operation increases but this time slowly. So 0(log-n) is more efficient than o(n). Example of this algorithm is a binary search algorithm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;0(n*2):&lt;/strong&gt; This is the most slowest complexity an algorithm can have and can be seen when accessing an array inside of an array. &lt;/p&gt;

&lt;p&gt;I also learned about the different operating systems, programming paradigms and algorithms.&lt;/p&gt;

&lt;p&gt;I hope to learn more from the school and share my updates with you. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript Fundamentals</title>
      <dc:creator>jamilu jibrilla</dc:creator>
      <pubDate>Mon, 27 Jun 2022 23:08:00 +0000</pubDate>
      <link>https://dev.to/jamil/javascript-fundamentals-2k9e</link>
      <guid>https://dev.to/jamil/javascript-fundamentals-2k9e</guid>
      <description>&lt;p&gt;Like any other programming language, knowing the basic concepts of a language will help your understanding and usage of the language. In this article, we'll be learning about some of the basic concepts you need to know when writing JavaScript. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to start writing JavaScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can write JavaScript code directly in your browser, if you are using a windows/Linux operating system, open your console by clicking &lt;code&gt;ctrl + shift + j&lt;/code&gt;, on macOS simply click &lt;code&gt;Option + ⌘ + J&lt;/code&gt;, This will open up your browser console where you can start writing some basic JavaScript code.&lt;/p&gt;

&lt;p&gt;You can also use a script tag inside your HTML file to write your JavaScript code or you can create a different file for your code and link it via the script tag.&lt;/p&gt;

&lt;p&gt;Writing JavaScript inside your script tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Example&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

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

  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="c1"&gt;// you can write your JavaScript code within this script tag&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;what is your name?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;alert&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="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

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

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

&lt;/div&gt;


&lt;p&gt;Linking your external JavaScript file:&lt;/p&gt;

&lt;p&gt;To do this, create a file that ends with the &lt;code&gt;.js&lt;/code&gt; extension and link it via the script tag. Example, you have a file named &lt;code&gt;script.js&lt;/code&gt; in the same directory(folder) with your HTML file.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Example&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"script.js"&lt;/span&gt; &lt;span class="na"&gt;defer&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello world&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The src attribute specifies the url of the external file.&lt;/p&gt;

&lt;p&gt;Now that we've seen how to get started with writing JavaScript code, let's look at some of its fundamental concepts.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;STATEMENTS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A statement is an instruction, it tells the computer what to do. Any piece of code that returns a value is a statement. Below is an example of what a statement looks like in JavaScript:&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="mi"&gt;2&lt;/span&gt; &lt;span class="o"&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;// → 4&lt;/span&gt;
&lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&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;// → 38&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello world&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// → "hello world"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;COMMENTS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;comments are used to add descriptions to our code, it helps us understand what action a particular line of code is performing. Anything written in a comment block would be ignored by the interpreter(meaning it won't be executed). Comments can be written on one line or it can span across multiple lines (this is called a multi line comment).&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    console.log("This code works");

//  This is an example of single line comment
//  console.log("single line comment, this won't be executed")

/*
  This is a multi line comment,
  it spans across multiple lines
  Anything written inside here will be ignored
  console.log("multi line comment");
*/

 // Click run to see the output


  &lt;/code&gt;
&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;VARIABLE&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Variables helps us to clearly understand our code by labelling the data's that we have in our program. Think of variable as a container that stores value, this value can then later be used in our code by referencing that variable name. There are some certain rules to follow when creating variables. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Naming conventions&lt;/strong&gt;&lt;br&gt;
When naming your variable's in JavaScript, the following rules should be followed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The name must contain only letters, digits, or the symbols $ 
and _.&lt;/li&gt;
&lt;li&gt;The first character must not be a digit.&lt;/li&gt;
&lt;li&gt; Variables are case sensitive &lt;code&gt;let name; and let NAME&lt;/code&gt; are not 
the same.&lt;/li&gt;
&lt;li&gt;Always name your variables in a clean, obvious and human 
readable format, a variable should describe clearly the data it 
holds, doing this will keep your code clean.&lt;/li&gt;
&lt;li&gt;Do not use hyphens to separate between two or multiple words.
&lt;/li&gt;
&lt;/ol&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;first&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → this is wrong&lt;/span&gt;
   &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → this is correct &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To create a variable, we use the let or const keyword.&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;username1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Moses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → using let keyword&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jacob&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → using const keyword&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;What's the difference?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using const to create a variable will define a constant reference to the value that the variable holds, variables created using const cannot be reassigned. For example, you cannot do this:&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
 const age = 40;
 age = 50;
 console.log(age)

  &lt;/code&gt;
&lt;/div&gt;



&lt;p&gt;This will throw an error: &lt;br&gt;
&lt;code&gt;TypeError: Assignment to constant variable...&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;but this is possible using let:&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
 let age = 40;
 age = 50;
 console.log(age)

  &lt;/code&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Variables created using let can be declared first and be initialized later.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
let a;  // → declared variable with name a
a = 40; // → initialized a with a value 0f 40

  &lt;/code&gt;
&lt;/div&gt;


&lt;p&gt;while const variables must be initialized during declaration&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;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → variable is declared and initialized.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Not declaring and initializing const variable at once will result in an error.&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
const a; // → variable declared with name a
a = 40;  // → initialized a with a value of 40

  &lt;/code&gt;
&lt;/div&gt;



&lt;p&gt;this returns an error&lt;code&gt;Uncaught SyntaxError: Missing initializer in const declaration&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can also declare multiple variable at once in the same statement, just as in the code below:&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
const name = "Mike", surname = "John"; // → creates a variable name and surname using const keyword.
console.log(name, surname)

let  firstName = "Moses", lastName = "Adebayo"; // → creates a variable firstName and lastName using let key word.
console.log(firstName, lastName)

  &lt;/code&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; Variables created using let and const cannot be redeclared. You cannot declare the same variable more than once.&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    
  &lt;/code&gt;
  &lt;code&gt;
    
let name = "arthur";
let name = "moses";

  &lt;/code&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;VAR&lt;/strong&gt;&lt;br&gt;
Variable's can also be created using the var keyword, however this should be avoided as it can cause some weird behaviour in your code especially if you are not familiar with it. The normal way of creating a variable is using let and const, you can read more about using the var keyword &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;DATA TYPES&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Data type is the classification of the different types of data which we can use within our code. In programming, each value is of a particular type and each data type has some set of operations that could be applied to it. While some of this operations are unique to a data type, some operations can be carried out on more data one data type. For example the addition operation can be performed on both a string and a number data type, although they behave differently, below are some of the most basic data types in JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STRING&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A string is a value or collection of values wrapped inside of a quote. You can use a single quote(' '), double quote(" ") or backticks to create a string.&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;str1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → Double quote&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → single quote&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`hello`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → backtick&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; Using the same kind of quote within a string would result in an error. You cannot do 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;sentence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This is &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;superb&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;returns an &lt;code&gt;Error: Uncaught SyntaxError: Unexpected string&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;but using a different kind of quote will work. Eg, using a double quote inside a single quoted string:&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;sentence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is "superb"&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//  or&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sentence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`This is "superb"`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Number&lt;/strong&gt;&lt;br&gt;
Number represents an integer or a floating point number, the number type as the name suggests only contain numbers, string cannot be added to it.&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;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → correct&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;123452&lt;/span&gt;&lt;span class="nx"&gt;abcd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → incorrect&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;BigInt&lt;/strong&gt;&lt;br&gt;
  In JavaScript, the Number type has some certain limitations. Integers greater than 9007199254740991 (2*&lt;em&gt;53 -1) or less than -9007199254740991 (-(2&lt;/em&gt;*53 -1)) for negatives, cannot be represented using the Number type. BigInt allows us to represent integers that cannot be represented by the number type. we create a BigInt by appending "n" to the end of a number or Using the BigInt constructor to wrap the values. Example:&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="cm"&gt;/* Here num loses its precision because its value is the greater
   than the maximum number JavaScript can represent(2**53 -1).
*/&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9999999999999999&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;num&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    &lt;span class="c1"&gt;// → 10000000000000000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To solve this, wrap the number in a BigInt constructor or append n to the number.&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;bigInt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9999999999999999&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → 9999999999999999 &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;bigInt1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;BigInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9999999999999999&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// → 9999999999999999&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Boolean&lt;/strong&gt;&lt;br&gt;
A Boolean contains only two values, true or false. we use a Boolean to represent a state/condition. It acts like a switch, it can either be On or Off. Booleans can be gotten as a result of comparisons, for Example:&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;isLessThan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → returns `true` &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;isGreaterThan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → returns `false`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can also directly assign a Boolean value to a variable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let itemExist = True;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Null and Undefined&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Null&lt;/strong&gt; means empty or value unknown, we use null when we want to indicate that the value of a variable is unknown. Example:&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Undefined&lt;/strong&gt;&lt;br&gt;
While we assign a null value to indicate absence of a value, JavaScript uses Undefined as its default way of letting us know that a variable is not yet assigned a value. For example, when you try to access a variable that is declared but not assigned a value, it returns undefined&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;name&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;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// → returns undefined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technically, you can also assign an undefined value to a variable, but it is not recommended as that's the reserved/default way the language to indicate the absence of a value. Use null to indicate that a variable's value is not yet known.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OBJECTS&lt;/strong&gt;&lt;br&gt;
Object is a special type in JavaScript, all other types are called primitive types because they can only be of a single data type, either a string, Boolean or number but it cannot contain both at the same time. Objects allows us to store more than a single value at a time and the value can be of any type. Below is an example of an object containing more than one data type.&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;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;moses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;123456&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;:&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;2&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&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="kc"&gt;false&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;The above object contains a string, number, Boolean, and array(this is a special type of object).&lt;/p&gt;

&lt;p&gt;To access a value in an object, we call the object name followed by &lt;code&gt;.&lt;/code&gt; then the key that holds the value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;  &lt;span class="c1"&gt;// → 'moses'&lt;/span&gt;
&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tel&lt;/span&gt; &lt;span class="c1"&gt;// → 123456&lt;/span&gt;
&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;  &lt;span class="c1"&gt;// → [1,2,3,"name", true, false]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; To check the data type of a value, use the typeof operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// → String &lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="mi"&gt;123&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → Number&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// → Boolean&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above are some of the most common data type you'll come across when writing JavaScript.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;LOOPS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We use loops when we want to run a piece of code repeatedly. The three basic kind of loops are: &lt;code&gt;For loop&lt;/code&gt;, &lt;code&gt;While loop&lt;/code&gt; and the &lt;code&gt;Do While&lt;/code&gt; loop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Loop&lt;/strong&gt;&lt;br&gt;
The for loop has the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;decrement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// loop body or code to be executed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The statement is executed once before the loop starts running&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the condition returns true, the loop body will be executed &lt;br&gt;
again, if false the loop ends.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increment/decrement occurs each time the loop body executes, &lt;br&gt;
without it the loop will execute forever or until our browser &lt;br&gt;
crashes(this is called infinite loop)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example code:&lt;br&gt;
let's say you have a piece of code that you want to run three times&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;user1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;anonymous&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// this above alerts "anonymous" three times in your browser&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of repeating the same code, you can use a for loop to achieve the same result:&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;user1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;anonymous&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="mi"&gt;3&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;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user1&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;&lt;strong&gt;While Loop&lt;/strong&gt;&lt;br&gt;
The while loop has the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// loop body or code to be executed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;if the condition returns true, the loop body will continue to be 
executed. You might wondering, won't that cause an infinite 
loop?. Yes, that's why it's important to set a stop condition 
inside the loop body.
&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;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="kd"&gt;let&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;anonymous&lt;/span&gt;&lt;span class="dl"&gt;"&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;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;alert&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;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="c1"&gt;// this is the same as doing i+=1 &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;do while Loop&lt;/strong&gt;&lt;br&gt;
While the code inside the body of a while loop runs as long as the condition returns true, the do while runs the loop body once before checking the condition, if true, it runs again else the loop ends. The do while loop has the following syntax&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c1"&gt;// loop body&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;condition&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example code:&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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;alert&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="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;5&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 above code, the loop body will run once before checking the condition, if it return false then the loop ends. Use a do while loop in cases where you need to run some code at least once regardless of your condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; it is important to set a stop condition on a loop to avoid creating an infinite loop.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Javascript</title>
      <dc:creator>jamilu jibrilla</dc:creator>
      <pubDate>Mon, 27 Jun 2022 09:17:12 +0000</pubDate>
      <link>https://dev.to/jamil/introduction-to-javascript-3c6e</link>
      <guid>https://dev.to/jamil/introduction-to-javascript-3c6e</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is JavaScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;if you are trying to decide what programming language to learn, this article will give you an insight on the JavaScript language and some of the things that you can achieve using JavaScript. &lt;/p&gt;

&lt;p&gt;JavaScript is a scripting language that is used to develop websites. Used with HTML and CSS it is one of the core technologies used when creating websites.&lt;/p&gt;

&lt;p&gt;While HTML and CSS are used to markup text and style your websites respectively, JavaScript helps bring your website to life by adding interactivity to the site, this way a user is able to communicate or interact with contents on the site.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A brief history&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During the late 1990's, people only had static websites (meaning you cannot interact with a website, stuffs like listening to events and adding interactivity to a website was not possible, you can only browse and read information from the web).&lt;/p&gt;

&lt;p&gt;JavaScript was created in 1995 by Brendan Eich, it was initially created to solve this particular problem of having non-interactivity on the web. Today, JavaScript has evolved from a language that was only being used on the browser to a widely used language that can run almost everywhere, it now runs on a server or any device that has a special program called JavaScript engine.&lt;/p&gt;

&lt;p&gt;Browsers by default has an embedded engine called JavaScript virtual Machine(JVM) , you might be asking, what is a JVM?&lt;/p&gt;

&lt;p&gt;The JavaScript Virtual Machine is a software component used to execute JavaScript code&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The engine reads the code.&lt;/li&gt;
&lt;li&gt; It then converts it to machine language.&lt;/li&gt;
&lt;li&gt; The machine language then runs fast.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Some features of JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is an interpreted language (meaning it doesn't need a compiler to translate your code into machine language before it can be executed), it runs directly in your browser.&lt;/p&gt;

&lt;p&gt;compiled languages are read and translated into a machine understandable code before being executed, while an interpreted language is executed line by line as the program reads it.  &lt;/p&gt;

&lt;p&gt;JavaScript is a dynamically typed language, this mean you do not need to explicitly define the data type of variable you are creating, it also means that you can override or change the data type of a variable at any time. Programs written in JavaScript are called scripts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is JavaScript different from Java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many assume the relation between the two languages because they have similar names, but JavaScript and java are two different languages. When JavaScript was created initially, it was called mocha and then later it was renamed to liveScript and JavaScript eventually. &lt;a href="https://stackoverflow.com/questions/2018731/why-is-javascript-called-javascript-since-it-has-nothing-to-do-with-java"&gt;read more&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is JavaScript Used for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can do a lot with JavaScript this days, from adding interactivity to your websites, to setting up and configuring your server or even creating a robot machine.&lt;/p&gt;

&lt;p&gt;Below are some few things you can achieve using JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding interactivity to your websites by:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Dynamically changing the contents(HTML) of a webpage&lt;/li&gt;
&lt;li&gt; Modifying the contents of a webpage.&lt;/li&gt;
&lt;li&gt; Change existing styles of a webpage.&lt;/li&gt;
&lt;li&gt; Show or hide existing contents on a webpage
&lt;/li&gt;
&lt;li&gt; Display animations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Building web servers and developing server applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Apart from using JavaScript on the frontend to develop your website/app. Developers can use JavaScript to build simple web servers using node JS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Game development&lt;/strong&gt;&lt;br&gt;
You can use JavaScript to create games that run in your &lt;br&gt;
browser. This is a great way for developers to practice their skills.&lt;/p&gt;

&lt;p&gt;One of the advantages of JavaScript is that it runs almost everywhere, you can run JavaScript on any device that has a JavaScript engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programs written in JavaScript are called scripts.&lt;/li&gt;
&lt;li&gt;It is a core tool required in building websites/webapps. &lt;/li&gt;
&lt;li&gt;JavaScript was first created as a language to be used on the browser to create interactive websites, which later evolved and is now used in different environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;in my next article, we will discuss about some of the basic and fundamental concepts of JavaScript.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>The World Wide Web</title>
      <dc:creator>jamilu jibrilla</dc:creator>
      <pubDate>Wed, 02 Mar 2022 07:05:15 +0000</pubDate>
      <link>https://dev.to/jamil/the-world-wide-web-1b3f</link>
      <guid>https://dev.to/jamil/the-world-wide-web-1b3f</guid>
      <description>&lt;p&gt;The web, which is the common name for the "World Wide Web" has come a long way since it's inception. The first version of the web was "read only", in other words, you can only search for information and read it, there was little or no interaction.&lt;/p&gt;

&lt;p&gt;In this article we'll discuss about differences between web2 and web3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DIFFERENCES BETWEEN WEB2 AND WEB3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WEB2&lt;/strong&gt; is the version of the web most of know today, it allows users to interact with different applications. This applications makes sharing and collaboration between users possible and help them to express themselves online.&lt;/p&gt;

&lt;p&gt;You can think of web2 as the interactive and social web, this version of the web is dominated by companies like Facebook,Twitter, TikTok, Whatsapp to name a few that provides services in exchange for your personal data. it also supports centralization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ADVANTAGES&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ease of usage&lt;/li&gt;
&lt;li&gt;Available at any time, any place.&lt;/li&gt;
&lt;li&gt;Ease of access to information and resources.&lt;/li&gt;
&lt;li&gt;Opportunity to know different people staying around the 
world.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;DISADVANTAGES&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Lack of privacy.&lt;/li&gt;
&lt;li&gt;susceptible to hackers.&lt;/li&gt;
&lt;li&gt;Because it is centralized, companies can deny you access 
to their services at any given time. &lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;WEB3&lt;/strong&gt; is the next generation of the internet. it allows everyone to participate as a user or developer without monetizing your personal data, everything that can be done on web2 can also be done in web3 but in a decentralized manner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ADVANTAGES&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No one can block you or deny you access to a service.&lt;/li&gt;
&lt;li&gt;Elimination of centralization&lt;/li&gt;
&lt;li&gt;Ownership of information or data&lt;/li&gt;
&lt;li&gt;immutability.&lt;/li&gt;
&lt;li&gt;minimized possibility of data leaks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;DISADVANTAGES&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cost.&lt;/li&gt;
&lt;li&gt;Transactions are slower as they deal with high 
computational power.&lt;/li&gt;
&lt;li&gt;it will be inaccessible to less advanced devices.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are some of the major differences in web2 and web3.&lt;/p&gt;

&lt;p&gt;To learn more about web3 and blockchain technlogies, join &lt;a href="https://blockgames.gg/"&gt;blockgames&lt;/a&gt; which is brought to you by &lt;a href="https://nestcoin.com/"&gt;Nestcoin&lt;/a&gt; in partnership with &lt;a href="https://zuri.team/"&gt;zuri&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>web2</category>
    </item>
  </channel>
</rss>
