<?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: Maxwell_Munene</title>
    <description>The latest articles on DEV Community by Maxwell_Munene (@munenemuriukim).</description>
    <link>https://dev.to/munenemuriukim</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%2F660500%2F43f39b0a-ef0c-4be0-9b22-f324fd127014.JPG</url>
      <title>DEV Community: Maxwell_Munene</title>
      <link>https://dev.to/munenemuriukim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/munenemuriukim"/>
    <language>en</language>
    <item>
      <title>JavaScript 101: Ultimate JavaScript Guide</title>
      <dc:creator>Maxwell_Munene</dc:creator>
      <pubDate>Tue, 02 Aug 2022 00:15:00 +0000</pubDate>
      <link>https://dev.to/munenemuriukim/javascript-101-ultimate-javascript-guide-17id</link>
      <guid>https://dev.to/munenemuriukim/javascript-101-ultimate-javascript-guide-17id</guid>
      <description>&lt;p&gt;Javascript is a scripting language that works alongside HTML and CSS to enhance code functionality and add interactive elements. It can be embedded in HTML using the  tag and is an interpreted language, which means it is not compiled.&amp;lt;br&amp;gt;
As a beginner, the best approach to JavaScript would be to understand its basic building blocks. Here goes:-&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;JavaScript Variables&amp;lt;br&amp;gt;
A variable is a container in which you place any literal value into, or assign it to represent an object that you have created.&amp;lt;br&amp;gt;
Variables can be changed or operations performed on them. Each variable created can be associated with an object or datatype that you can access the properties and methods&amp;lt;br&amp;gt;
&amp;lt;/p&amp;gt;
&amp;lt;div class="highlight"&amp;gt;&amp;lt;pre class="highlight plaintext"&amp;gt;&amp;lt;code&amp;gt;var a = 5;
a = 10;
var b = 3;
var c = a + b;

var person1 = "Bill";
var person2 = "Sara";
var myText = person1 + "went to school with + person2;
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Variable declaration and initialization examples&amp;lt;br&amp;gt;
There are three different variable types: &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;let&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;const&amp;lt;/code&amp;gt;. Each of these variables has several rules around how they should be used and have different characteristics.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Javascript Arrays&amp;lt;br&amp;gt;
An array is a variable type in any programming language used to store multiple values simultaneously. Arrays store data in the form of elements, therefore, an array is a collection of elements.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;We can store multiple data types in arrays, like strings, integers, arrays, or even functions.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Array are divided into four types:&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Homogeneous arrays&amp;lt;br&amp;gt;
Heterogeneous arrays&amp;lt;br&amp;gt;
Multidimensional arrays&amp;lt;br&amp;gt;
Jagged arrays. read more &amp;lt;a href="https://linuxhint.com/javascript-arrays-beginner-guide/"&amp;gt;https://linuxhint.com/javascript-arrays-beginner-guide/&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;/p&amp;gt;
&amp;lt;div class="highlight"&amp;gt;&amp;lt;pre class="highlight plaintext"&amp;gt;&amp;lt;code&amp;gt;var languages = ["javascript", "python", "java"];
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;Array example&amp;lt;br&amp;gt;
Javascript Object&amp;lt;br&amp;gt;
A JavaScript object is an unordered collection of key-value pairs. Each key-value pair is a property. The key can be a string and the value of a property can be of any value eg. string, number, array and function.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;There are many ways to create an object, the most commonly used one is the object literal notation. To create an object with properties you use the key-value pair with curly braces.&amp;lt;br&amp;gt;
&amp;lt;/p&amp;gt;
&amp;lt;div class="highlight"&amp;gt;&amp;lt;pre class="highlight plaintext"&amp;gt;&amp;lt;code&amp;gt;let person = {
firstName: "John",
lastName: "Doe",
}
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;An object&amp;lt;br&amp;gt;
There are Standard built-in objects that you will need to be familiar with. They include:-&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;String Object&amp;lt;br&amp;gt;
Array Object&amp;lt;br&amp;gt;
Date Object&amp;lt;br&amp;gt;
Math Object&amp;lt;br&amp;gt;
Number Object&amp;lt;br&amp;gt;
RegExp Object&amp;lt;br&amp;gt;
Boolean Object&amp;lt;br&amp;gt;
Function Object&amp;lt;br&amp;gt;
JavaScript Functions&amp;lt;br&amp;gt;
JavaScript code is run inside a function. They allow us to write code that will be used over and over again keeping your code dry. A function is executed when ‘something’ invokes/ calls it:-&amp;lt;/p&amp;gt;

&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;when an event occurs (click event).&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;When it is invoked from JS code.&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;When it’s an automatic call (self invoked).&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;

&amp;lt;p&amp;gt;Also, learn how to use arrow functions in JavaScript ES6.&amp;lt;br&amp;gt;
&amp;lt;/p&amp;gt;
&amp;lt;div class="highlight"&amp;gt;&amp;lt;pre class="highlight plaintext"&amp;gt;&amp;lt;code&amp;gt;function name(parameter1, parameter2, parameter3) {
//code to be executed
}
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;A basic function example&amp;lt;br&amp;gt;
JavaScript Conditions and loops&amp;lt;br&amp;gt;
Conditions evaluate things and add logic to your scripts&amp;lt;br&amp;gt;
You require a full understanding of the comparison operators essential for conditional programming.&amp;lt;br&amp;gt;
They include:-&amp;lt;/p&amp;gt;

&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;if-else&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;switch-break&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;ternary&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;

&amp;lt;p&amp;gt;A loop is a programming construct that repeatedly executes a piece of code as long as a certain condition is met.&amp;lt;br&amp;gt;
JavaScript now supports five different types of loops:&amp;lt;/p&amp;gt;

&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;while&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;do…while&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;for&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;for…in&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;for…of&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;

&amp;lt;p&amp;gt;Summary&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;ECMAScript 2015 also known as ES6 was the second major revision to JavaScript that came with important new features that you need to be familiar with. &amp;lt;a href="https://www.w3schools.com/js/js_es6.asp"&amp;gt;https://www.w3schools.com/js/js_es6.asp&amp;lt;/a&amp;gt; read more on JavaScript ES6.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;This article will give you an overview guide to learning JavaScript’s basic concepts the best way.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;follow me on twitter&amp;lt;a href="https://twitter.com/MaxwellmuneneM"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Modern JavaScript for everyone: Mastering Modern JavaScript The Right Way</title>
      <dc:creator>Maxwell_Munene</dc:creator>
      <pubDate>Fri, 04 Mar 2022 21:46:00 +0000</pubDate>
      <link>https://dev.to/munenemuriukim/modern-javascript-for-everyone-mastering-modernjavascript-the-right-way-gml</link>
      <guid>https://dev.to/munenemuriukim/modern-javascript-for-everyone-mastering-modernjavascript-the-right-way-gml</guid>
      <description>&lt;p&gt;Coucou! I'm going to briefly share what I know about modern JavaScript and the necessary concepts that you need to master in ES6.&lt;/p&gt;

&lt;p&gt;ECMAScript 2015/ ES2015(ES6) was the first major update to JavaScript since ES5.&lt;/p&gt;

&lt;p&gt;Let's look at the new ES6 syntax.&lt;/p&gt;

&lt;h2&gt;
  
  
  let, const
&lt;/h2&gt;

&lt;p&gt;ES6 came with &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; as an addition to the good old &lt;code&gt;var&lt;/code&gt;. Any variable declared with &lt;code&gt;var&lt;/code&gt; outside a function block is available in the whole window.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let&lt;/code&gt; is now more preferred for variable declaration. It is block-scoped, meaning anything within the curly &lt;code&gt;{}&lt;/code&gt; is a block and cannot be accessed outside of the block.&lt;br&gt;
&lt;code&gt;let&lt;/code&gt; can be &lt;strong&gt;updated&lt;/strong&gt; but not *&lt;em&gt;re-declared *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = "John";
name = "Jane"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = "John"
let name = "Jane"//error:identifier 'name' has already been declared
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, if the same variable is declared in different scopes there will be no error because they are treated as different variables.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const&lt;/code&gt; is used to declare constant variables. It is also block-scoped but then it &lt;strong&gt;cannot&lt;/strong&gt; be &lt;strong&gt;updated&lt;/strong&gt; or &lt;strong&gt;re-declared&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = "John"
name = "Jane" //error: Assignment to constant variable.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objects declared with &lt;code&gt;const&lt;/code&gt; cannot be updated however, the &lt;strong&gt;properties can&lt;/strong&gt; be updated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const human = {
name: "John",
gender: "male"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;human.name = "Justin" //is updated without errors
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rest Parameter &lt;code&gt;(a, b...args)&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;in ES6, a function definition's &lt;strong&gt;last&lt;/strong&gt; parameter can be prefixed with &lt;code&gt;...&lt;/code&gt; which allows all the remaining &lt;em&gt;'the rest'&lt;/em&gt; parameters to be placed within a standard JS array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunc(a, b, ...more){
console.log('more', more) //output: ['c','d','e']

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

&lt;/div&gt;



&lt;p&gt;In layman's, &lt;code&gt;...rest&lt;/code&gt; bundles all the extra parameters into a single array.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spread Operator (...)
&lt;/h2&gt;

&lt;p&gt;Spread allows an iterable such as an array expression or string to be expanded in places where zero or more arguments or elements are expected, or an object expression to be expanded in places where zero or more key-value pairs are expected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sum (x, y){
return x + y;
}
const numbers = [1, 2];
console.log(sum(...numbers)); //output: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spread syntax can be used when all elements from an object or array need to be included in a list of some kind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Template Literals
&lt;/h2&gt;

&lt;p&gt;Template literals are enclosed by backticks character instead of quotes. They are used to allow embedded expressions called &lt;strong&gt;substitutions&lt;/strong&gt;&lt;br&gt;
They can contain placeholders indicated by the dollar and curly braces. &lt;br&gt;
&lt;code&gt;${expression}&lt;/code&gt;&lt;br&gt;
These expressions in the placeholders and the text between the backticks get passed to a function.&lt;br&gt;
To escape a backtick in a template literal, put a backslash  &lt;code&gt;\&lt;/code&gt; before the backtick&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`\`` === '`' //true

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrow function
&lt;/h2&gt;

&lt;p&gt;This is a compact alternative to the traditional function expression, but is limited and cannot be used in all situations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Traditional
function (a){
return a + 10;
}

//Arrow Function
(a) =&amp;gt; {
return a + 10;
}
//Also
a =&amp;gt; a + 10;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Differences and limits&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Doesn't have its own bindings to &lt;code&gt;this&lt;/code&gt; or &lt;code&gt;super&lt;/code&gt; and &lt;strong&gt;cannot&lt;/strong&gt; be used as a &lt;strong&gt;method&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Doesn't have a &lt;code&gt;new.target&lt;/code&gt; keyword.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is not suitable for &lt;code&gt;call&lt;/code&gt;, &lt;code&gt;apply&lt;/code&gt; and &lt;code&gt;bind&lt;/code&gt; methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cannot be used as &lt;strong&gt;constructors&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cannot use &lt;code&gt;yield&lt;/code&gt; within its body.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  For Of Loop
&lt;/h2&gt;

&lt;p&gt;With for of, you can iterate over iterable data structures such as arrays, strings, maps etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var num = [0, 1, 2, 3, 4];
for (let i of num)
{
console.log(i); // 0 1 2 3 4
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Array Methods
&lt;/h2&gt;

&lt;p&gt;Some new array methods were introduced in ES6 that are needed to master. They include:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.from()&lt;/code&gt;&lt;/strong&gt; Converts array-like values and iterable values into arrays.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.of()&lt;/code&gt;&lt;/strong&gt; Creates an instance from a variable number of arguments instead of the number of arguments or types.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.prototype.copyWithin()&lt;/code&gt;&lt;/strong&gt; Copies the part of an array to a different location within the same array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.prototype.find()&lt;/code&gt;&lt;/strong&gt; It finds a value from an array, based on the specific criteria that are passed to this method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.prototype.keys()&lt;/code&gt;&lt;/strong&gt; It returns an array iterator object along with the keys of the array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;Array.protorype.values()&lt;/code&gt;&lt;/strong&gt; it provides the value of each key.&lt;br&gt;
Try to understand these (among Other) new array methods.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fully master Javascript you should have a good knowledge of ES5 as ES6 just polishes up to give more functionality to the JavaScript language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Libraries and Frameworks
&lt;/h2&gt;

&lt;p&gt;Once you are conversant with vanilla JavaScript, it is only right to go into Frameworks and Libraries.&lt;br&gt;
A JavaScript framework is a collection of pre-written code built to support applications and provide benefits that plain JavaScript does not offer on its own.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Node.js&lt;/strong&gt; - is an open-source, runtime environment built to execute JavaScript outside of a browser, which distinguishes it from the front-end focused frameworks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is designed to build network applications at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React&lt;/strong&gt; -  is a fast, scalable, and reusable framework for building interactive user interfaces (UIs). Like Vue, React supports incremental use and uses the virtual DOM model for expedited updates of web page content. Naturally, it mainly supports the View piece of the Model-View-Controller (MVC) paradigm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vue.js&lt;/strong&gt; - Vue is a front-end JavaScript framework that is designed to be approachable, versatile, and fast with a core focus on building single-page applications (SPAs).&lt;br&gt;
Vue's central library focuses on the View layer of the MVC architecture and uses the virtual DOM model for fast updates without needing to reload the page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Angular&lt;/strong&gt; - Angular uses data binding, which automatically synchronizes data between the database and the client, saving developers from having to define requests and responses when a user interacts with the UI. The framework also supports dynamic rendering with its JSON-based processor. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;An Ideal JavaScript roadmap will require one to up-skill from the basic JavaScript, ES6 and finally working with Framework(s) to build modern web products.&lt;/p&gt;

&lt;p&gt;I recommend &lt;a href="//freecodcamp.org"&gt;freecodecamp&lt;/a&gt; and the MDN web docs &lt;br&gt;
 &lt;a href="https://developer.mozilla.org"&gt;MDN web docs&lt;/a&gt; as great resources, among others, for you to master JavaScript from the ground up. I Hope this is helpful.&lt;br&gt;
_Let's code,&lt;br&gt;
Cheers! _&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>100daysofcode</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DATA STRUCTURES &amp; ALGORITHMS - MODERN JS</title>
      <dc:creator>Maxwell_Munene</dc:creator>
      <pubDate>Mon, 21 Feb 2022 21:43:46 +0000</pubDate>
      <link>https://dev.to/munenemuriukim/data-structures-algorithms-modern-js-1m01</link>
      <guid>https://dev.to/munenemuriukim/data-structures-algorithms-modern-js-1m01</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When you build software there are many topics you need to think through first in order to achieve the goal and have a nice result.&lt;/p&gt;

&lt;p&gt;You need to ask yourself questions such as:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How are you going to store data?&lt;/li&gt;
&lt;li&gt;How are you going to deal with static logic?&lt;/li&gt;
&lt;li&gt;How will you handle authentication? Etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Algorithms
&lt;/h2&gt;

&lt;p&gt;An Algorithm is a step-by-step procedure that defines a set of instructions to be executed in a certain order to get the desired output.&lt;/p&gt;

&lt;p&gt;Algorithms are generally independent of the underlying languages. They can therefore be implemented in more than one language.&lt;/p&gt;

&lt;p&gt;The main properties of an algorithm that you can consider include:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input- An algorithm must possess 0 or more well-defined inputs supplied externally to the algorithm.&lt;/li&gt;
&lt;li&gt;Output- An algorithm should have 1 or more well-defined outputs as desired.&lt;/li&gt;
&lt;li&gt;Correctness- Every step of the algorithm must generate correct output.&lt;/li&gt;
&lt;li&gt;Definiteness-Algorithms should be clear/unambiguous, thus every step of the algorithm should be clear and well defined.&lt;/li&gt;
&lt;li&gt;Finiteness- The algorithm should have a finite number of steps that must be carried out to achieve the task at hand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing that makes algorithms worth studying is that in most cases, there exists more than one algorithm capable of handling the task at hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Structures
&lt;/h2&gt;

&lt;p&gt;Data structures enable us to manage and utilize large datasets, handle multiple requests from users at once, and speed up data processing.&lt;/p&gt;

&lt;p&gt;Therefore, learning Data Structures and Algorithms allows us to write different efficient and optimised computer programs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s take a look at types of Data Structures in JS&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;This is the most basic of all data structures. Basically, an array is a container object that is used to hold a list of items usually of the same type. &lt;/p&gt;

&lt;p&gt;Each array has a fixed number of cells decided on its creation, and each cell has a corresponding numeric index used to select its data.&lt;/p&gt;

&lt;p&gt;JavaScript has dynamic arrays i.e their size is not predetermined, nor the type of data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--In-ZKjlr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ye2jb813mg1b2byfdl07.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--In-ZKjlr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ye2jb813mg1b2byfdl07.png" alt="Image description" width="490" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The easiest way to create a JavaScript Array is using array literal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let arrayName = [element1, element2, element3, ...];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are common methods associated with arrays that you should know.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SjeeTcuH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ff60i11l3bkdejoetono.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SjeeTcuH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ff60i11l3bkdejoetono.png" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Common methods you should know&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Queues
&lt;/h2&gt;

&lt;p&gt;Queues are sequential structures that process elements in the order they have entered rather than the most recent element, also known as the FIFO(First In First Out). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f_yBpuuh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fl4yakz7lpxujosqabm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f_yBpuuh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fl4yakz7lpxujosqabm.png" alt="Image description" width="300" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Queue has the following associated JavaScript methods:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;enqueue: enter queue/add an element at the end.&lt;/li&gt;
&lt;li&gt;dequeue: leave queue/remove the front element and return it&lt;/li&gt;
&lt;li&gt;front: to get the first element&lt;/li&gt;
&lt;li&gt;isEmpty: determine whether the queue is empty&lt;/li&gt;
&lt;li&gt;size: get the number of element(s) in queue
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Queue() {
 var collection = [];
 this.print = function () {
   console.log(collection);
 }
 this.enqueue = function (element) {
   collection.push(element);
 }
 this.dequeue = function ()=&amp;gt; {
   return collection.shift();
 }
 this.front = function () {
   return collection[0];
 }

 this.isEmpty = function () {
   return collection.length === 0;
 }
 this.size = function () {
   return collection.length;
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;em&gt;JS implementation of a queue&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Applications of Queues&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They are helpful as a buffer for requests, storing each request in the order it was received until it can be processed.&lt;/li&gt;
&lt;li&gt;A convenient way to store order-sensitive data such as stored voicemails&lt;/li&gt;
&lt;li&gt;Ensures the oldest data is processed first&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;Similar to Queue, Stack is a linear data structure that follows the LIFO(Last In First Out) or FILO(First In Last Out) principle&lt;br&gt;
Stack is an abstract data type that serves as a collection of elements, with two principal operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;push, which adds an element to the stack, and&lt;/li&gt;
&lt;li&gt;pop, which removes the most recently added element that was not yet removed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4AXFeNiy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fk2rwqyo6dnd408f0ci.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4AXFeNiy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fk2rwqyo6dnd408f0ci.png" alt="Image description" width="773" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever we add an element to the stack, it is added at the top of the stack and also whenever we delete an element from the stack it is deleted from the top of the stack.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Stack() {
this.count = 0;
 this.storage = {};

 this.push = function (value) {
   this.storage[this.count] = value;
   this.count++;
 }

 this.pop = function () {
   if (this.count === 0) {
     return undefined;
   }
   this.count--;
   var result = this.storage[this.count];
   delete this.storage[this.count];
   return result;
 }

 this.peek = function () {
   return this.storage[this.count - 1];
 }

 this.size = function () {
   return this.count;
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;function stack example in JS&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Linked lists
&lt;/h2&gt;

&lt;p&gt;A Linked list is a linear collection of data elements, in which linear order is not given by their physical placement in memory. Instead, each element points to the next.&lt;/p&gt;

&lt;p&gt;A unilateral linked list normally has the following methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;size: Return the number of node(s)&lt;/li&gt;
&lt;li&gt;head: Return the element of the head&lt;/li&gt;
&lt;li&gt;add: Add another node in the tail&lt;/li&gt;
&lt;li&gt;remove: Remove certain node&lt;/li&gt;
&lt;li&gt;indexOf: Return the index of a node&lt;/li&gt;
&lt;li&gt;elementAt: Return the node of an index&lt;/li&gt;
&lt;li&gt;addAt: Insert a node at a specific index&lt;/li&gt;
&lt;li&gt;removeAt: Delete a node at a specific index
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = {
    head: {
        value: 6
        next: {
            value: 10                                             
            next: {
                value: 12
                next: {
                    value: 3
                    next: null  
                    }
                }
            }
        }
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;A simple js Linked list.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A new instance of the LinkedList object will have the head and tail pointers refer to the null value, while the length property will start at 0.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KtuaDowh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkcqdxpt1ndbukocnx5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KtuaDowh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkcqdxpt1ndbukocnx5r.png" alt="Image description" width="335" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are three known types of linked list data structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Singly-linked list where each node only has the next pointer&lt;/li&gt;
&lt;li&gt;Doubly linked list where each node as both next and previous pointer&lt;/li&gt;
&lt;li&gt;Circular linked list where the tail node points to the head node, creating a circle.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Data structures and algorithms can solve the most common problems efficiently. This will make a difference in the quality of the source code you write. This includes performance. &lt;/p&gt;

&lt;p&gt;If you choose the incorrect data structure or algorithm depending on the scenario, you can have some performance issues, therefore, this informs that Data structures and algorithms are core elements in any system or software development ecosystem.&lt;/p&gt;

&lt;p&gt;I hope I shed some light on DSA. &lt;br&gt;
&lt;em&gt;Cheers!&lt;/em&gt;&lt;/p&gt;

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