<?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: Pranish Shrestha</title>
    <description>The latest articles on DEV Community by Pranish Shrestha (@pranish07).</description>
    <link>https://dev.to/pranish07</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%2F780497%2F9dde57e1-6e59-4c71-b819-1f5e62f5dff1.png</url>
      <title>DEV Community: Pranish Shrestha</title>
      <link>https://dev.to/pranish07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pranish07"/>
    <language>en</language>
    <item>
      <title>25 Algorithms that all developers should know</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Wed, 02 Mar 2022 17:44:46 +0000</pubDate>
      <link>https://dev.to/pranish07/25-algorithms-that-all-developers-should-know-4ani</link>
      <guid>https://dev.to/pranish07/25-algorithms-that-all-developers-should-know-4ani</guid>
      <description>&lt;p&gt;&lt;strong&gt;Searching Algorithms&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Linear search&lt;/li&gt;
&lt;li&gt;Binary search&lt;/li&gt;
&lt;li&gt;Depth first search &lt;/li&gt;
&lt;li&gt;Breath first search&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Sorting&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Insertion sort&lt;/li&gt;
&lt;li&gt;heap sort
3.Counting sort&lt;/li&gt;
&lt;li&gt;merge sort&lt;/li&gt;
&lt;li&gt;selection sort&lt;/li&gt;
&lt;li&gt;Quick sort&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Graphs&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kruskal's Algorithm&lt;/li&gt;
&lt;li&gt;Les Algorithm&lt;/li&gt;
&lt;li&gt;Dijkstra's Algorithm&lt;/li&gt;
&lt;li&gt;Bellman Ford Algorithm&lt;/li&gt;
&lt;li&gt;Floyd Warshall Algorithm&lt;/li&gt;
&lt;li&gt;Topological sort Algorithm&lt;/li&gt;
&lt;li&gt;Flood Fill Algorithm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Arrays&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;kadane's Algorithm&lt;/li&gt;
&lt;li&gt;Floyd's Cycle detection Algorithm&lt;/li&gt;
&lt;li&gt;KMP Algorithm&lt;/li&gt;
&lt;li&gt;Quick select Algorithm&lt;/li&gt;
&lt;li&gt;Boyer - more majority vote Algorithm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Basics&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Huffman Coding Compression Algorithm&lt;/li&gt;
&lt;li&gt;Euclid's Algorithm&lt;/li&gt;
&lt;li&gt;Union Find Algorithm&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>career</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Some of web dev resources for beginners</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Tue, 01 Mar 2022 17:20:36 +0000</pubDate>
      <link>https://dev.to/pranish07/some-of-web-dev-resources-for-beginners-3o20</link>
      <guid>https://dev.to/pranish07/some-of-web-dev-resources-for-beginners-3o20</guid>
      <description>&lt;p&gt;&lt;a href="https://codedamn.com/50-days-of-js"&gt;50 days of js&lt;/a&gt;&lt;br&gt;
&lt;a href="https://css-tricks.com/"&gt;Css tricks&lt;/a&gt;&lt;br&gt;
&lt;a href="https://reactresources.com/"&gt;React resources&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.codewars.com/"&gt;codewars&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cs50.harvard.edu/college/2022/spring/"&gt;cs50&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoyy&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Here are some weird Javascript  </title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Mon, 28 Feb 2022 17:34:13 +0000</pubDate>
      <link>https://dev.to/pranish07/here-are-some-weird-javascript-27nh</link>
      <guid>https://dev.to/pranish07/here-are-some-weird-javascript-27nh</guid>
      <description>&lt;p&gt;written in console :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;typeof NaN
'number'

&amp;gt;9999999999999999
10000000000000000

&amp;gt;0.1 + 0.2 == 0.3
false

&amp;gt;Math.max()
-Infinity
&amp;gt;Math.min()
Infinity

&amp;gt;[]+[]
''

&amp;gt;[]+{}
'[object Object]'

&amp;gt;{}+[]
0

&amp;gt;true + true + true === 3
true

&amp;gt;true- true
0

&amp;gt;(!+[]+[]+![]).length
9

&amp;gt;91-"1"
90

&amp;gt;[]==0
true

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>30 JavaScript Projects for beginners</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Sun, 27 Feb 2022 03:39:29 +0000</pubDate>
      <link>https://dev.to/pranish07/30-javascript-projects-for-beginners-19oo</link>
      <guid>https://dev.to/pranish07/30-javascript-projects-for-beginners-19oo</guid>
      <description>&lt;p&gt;&lt;a href="https://javascript30.com/"&gt;30 javascript projects&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This projects includes :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JavaScript Drumkit&lt;/li&gt;
&lt;li&gt;CSS + JS Clock&lt;/li&gt;
&lt;li&gt;Playing with CSS Variables and JS&lt;/li&gt;
&lt;li&gt;Array Cardio Day 1&lt;/li&gt;
&lt;li&gt;Flex Panels Image Gallery&lt;/li&gt;
&lt;li&gt;Ajax Type Ahead&lt;/li&gt;
&lt;li&gt;Array Cardio Day 2&lt;/li&gt;
&lt;li&gt;Fun with HTML5 Canvas&lt;/li&gt;
&lt;li&gt;14 Must Know Dev Tools Tricks&lt;/li&gt;
&lt;li&gt;Hold Shift to Check Multiple Checkboxes&lt;/li&gt;
&lt;li&gt;Custom HTML5 Video Player&lt;/li&gt;
&lt;li&gt;Key Sequence Detection (KONAMI CODE)&lt;/li&gt;
&lt;li&gt;Slide In on Scroll&lt;/li&gt;
&lt;li&gt;Object and Arrays - Reference VS Copy&lt;/li&gt;
&lt;li&gt;LocalStorage and Event Delegation&lt;/li&gt;
&lt;li&gt;CSS Text Shadow Mouse Move Effect&lt;/li&gt;
&lt;li&gt;Sorting Band Names without articles&lt;/li&gt;
&lt;li&gt;Tally String Times with Reduce&lt;/li&gt;
&lt;li&gt;Unreal Webcam Fun&lt;/li&gt;
&lt;li&gt;Native Speech Recognition&lt;/li&gt;
&lt;li&gt;Geolocation based Speedometer and Compass&lt;/li&gt;
&lt;li&gt;Follow Along Links&lt;/li&gt;
&lt;li&gt;Speech Synthesis&lt;/li&gt;
&lt;li&gt;Sticky Nav&lt;/li&gt;
&lt;li&gt;Event Capture, Propagation, Bubbling and Once&lt;/li&gt;
&lt;li&gt;Stripe Follow Along Dropdown&lt;/li&gt;
&lt;li&gt;Click and Drag to Scroll&lt;/li&gt;
&lt;li&gt;Video Speed Controller UI&lt;/li&gt;
&lt;li&gt;Countdown Clock&lt;/li&gt;
&lt;li&gt;Whack A Mole Game&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also, for a better UI for Weather app &lt;br&gt;
&lt;a href="https://webdesign.tutsplus.com/tutorials/build-a-simple-weather-app-with-vanilla-javascript--cms-33893"&gt;Better UI for weather app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>projects</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Arrays in Javascript</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Sat, 26 Feb 2022 16:55:00 +0000</pubDate>
      <link>https://dev.to/pranish07/arrays-in-javascript-1dfb</link>
      <guid>https://dev.to/pranish07/arrays-in-javascript-1dfb</guid>
      <description>&lt;p&gt;Arrays in JavaScript is an object which stores a collection of multiple items in a single variable. &lt;/p&gt;

&lt;p&gt;Here are some important JavaScript arrays :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[9,10,23,66].at(-2) //23 

['a','b','c'].concat('h') //['a','b','c','h']

[1, 30, 39, 29, 10, 13].every((x)=&amp;gt; x &amp;lt; 40) //true 

[1,2,3].fill(5,1,2) //[1,5,5]

[2,4,5,6,8].filter((x) =&amp;gt; x % 2 === 0) //[2,4,6,8]

[2,4,5,6,8].find((x) =&amp;gt; x%2 === 0) //[2]

[2,4,5,6].findIndex((x) =&amp;gt; x%2 !==0) //2

[1,2,3].forEach(x =&amp;gt; console.log(x)) 
//1
//2
//3

[1,2,3].includes(2) //true

['a','b','c'].join() //"a,b,c"

['a','b','c'].indexOf('a') //0
or ['a','b','c'].indexOf('e') //-1

['a','b','c'].length //3

[1,3,5,7].map((x)=&amp;gt; x*2) //[2,6,10,14]

[1,2,3].push(4) // [1,2,3,4]

[1,2,3].pop() //[1,2]

[1,2,3,4]reduce((prev,cur)=&amp;gt;(prev + cur)) //10

[1,2,3,4].reverse() //[4,3,2,1]

[1,2,3].shift() //1

[2,3,5,6].some((x) =&amp;gt; x &amp;gt; 6) //false

[1,10000,5,2,2222,5555,7777,6666].sort() //[1,10000,2,2222,5,5555,6666,7777]

['a','b','c'].slice(1) //['b','c']

['a','b','d','e'].splice(2,0,'c') //['a','b','c','d','e']

destructuring
[a,b] = [10,20] //a= 10 , b=20

...(spread op)
[a,b,...rest] = [10,20,30,40,50]
console.log(rest); //[30,40,50]
console.log(a); [10];


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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>10 websites to look for a remote web dev jobs in 2022.👇</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Tue, 28 Dec 2021 00:07:29 +0000</pubDate>
      <link>https://dev.to/pranish07/10-websites-to-look-for-a-remote-web-dev-jobs-in-2022-547o</link>
      <guid>https://dev.to/pranish07/10-websites-to-look-for-a-remote-web-dev-jobs-in-2022-547o</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;a href="https://remotive.io/"&gt;remotive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//remoteleads.io"&gt;remoteleads&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//remoteok.io"&gt;remoteok&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//angel.co/jobs"&gt;angel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//justremote.co"&gt;justremote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//weworkremotely.com"&gt;weworkremotely&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//javascriptjob.xyz"&gt;javascriptjob&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//flexjobs.com"&gt;flexjobs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//solidgigs.com"&gt;solidgigs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//ynamitejobs.com"&gt;dynamitejobs&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion ⌛&lt;br&gt;
I hope you found these tips helpful. If you need any help please let me know in the comment section.&lt;/p&gt;

&lt;p&gt;👋 Thanks for reading, See you next time&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>career</category>
      <category>performance</category>
    </item>
    <item>
      <title>Eloquent JavaScript(Part I : Chapter 3/Functions) </title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Mon, 27 Dec 2021 12:15:07 +0000</pubDate>
      <link>https://dev.to/pranish07/eloquent-javascriptpart-i-chapter-3functions-1noi</link>
      <guid>https://dev.to/pranish07/eloquent-javascriptpart-i-chapter-3functions-1noi</guid>
      <description>&lt;p&gt;In this post, we will learn about: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defining a Function&lt;/li&gt;
&lt;li&gt;Bindings and Scopes&lt;/li&gt;
&lt;li&gt;Nested Scope&lt;/li&gt;
&lt;li&gt;Functions as Values&lt;/li&gt;
&lt;li&gt;Declaration Notation&lt;/li&gt;
&lt;li&gt;Arrow Functions&lt;/li&gt;
&lt;li&gt;The Call Stack &lt;/li&gt;
&lt;li&gt;Optional Arguments&lt;/li&gt;
&lt;li&gt;Closure&lt;/li&gt;
&lt;li&gt;Recursion&lt;/li&gt;
&lt;li&gt;Growing Functions&lt;/li&gt;
&lt;li&gt;Functions and Side Effects&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Defining a function
&lt;/h2&gt;

&lt;p&gt;A JavaScript function is a block of code designed to perform a particular task. It is executed when something invokes it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const square = function(x){
return x*x;
}
function cube(y){
return y*y*y;
}
console.log(square(12)); //144
console.log(cube(6)); //216

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

&lt;/div&gt;



&lt;p&gt;function is created with an expression that starts with the keyword function. Functions have a set of parameters(in this case x and y) and a body which contains a statement that are to be called when a function is called. Functions are always wrapped with braces'{}' even when there is only one statement.&lt;br&gt;
A function can have multiple parameters or no at all.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const makeNoise = function() {
  console.log("Pling!");
};

makeNoise();
// → Pling!

const power = function(base, exponent) {
  let result = 1;
  for (let count = 0; count &amp;lt; exponent; count++) {
    result *= base;
  }
  return result;
};

console.log(power(2, 10));
// → 1024
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some values produce a value, such as power, square and cube and some dont like makeNoise, whose only result is a side effect. A return statement determines the value the function returns. Functions that don’t have a return statement at all, such as makeNoise, similarly return undefined.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function name([parameter1, parameter2, parameter3) {
   statements
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bindings and Scopes
&lt;/h2&gt;

&lt;p&gt;Each binding(variable) has a scope, which is the part of the program in which the binding is visible.&lt;br&gt;
Scope is the accessibility of variables, functions, and objects in some particular part of your code during runtime. In other words, scope determines the visibility of variables and other resources in areas of your code.&lt;br&gt;
Variables defined inside a function are in local scope while variables defined outside of a function are in the global scope. &lt;/p&gt;

&lt;p&gt;JavaScript has 3 types of scope: block, function and global scope. Before ES6(2015) JavaScript only has global and function scope. ES6 introduced let and const variable which provide block scope in JavaScript. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block scope:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
var x=2; 
let y=4;
}
//x can be used here but y cannot be used here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Variables declared with the var keyword can NOT have block scope. &lt;br&gt;
   Local Scope: Variables declared within a JavaScript function, become LOCAL to the function. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function scope : Variables defined inside a function are not accessible (visible) from outside the function.Variables declared with var, let and const are quite similar when declared inside a function.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function number(){
var num = 2; //function scope
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Global scope: Variable outside of a function becomes a function.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x= 2;
//x can be used here
function sum(){
 //x can be used here
}
//x can be used here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Nested Scope
&lt;/h2&gt;

&lt;p&gt;Blocks and functions can be created inside other blocks and functions, producing multiple degrees of locality.It is known as nested scope.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const hummus = function(factor) {
  const ingredient = function(amount, unit, name) {
    let ingredientAmount = amount * factor;
    if (ingredientAmount &amp;gt; 1) {
      unit += "s";
    }
    console.log(`${ingredientAmount} ${unit} ${name}`);
  };
  ingredient(1, "can", "chickpeas");
  ingredient(0.25, "cup", "tahini");
  ingredient(0.25, "cup", "lemon juice");
  ingredient(1, "clove", "garlic");
  ingredient(2, "tablespoon", "olive oil");
  ingredient(0.5, "teaspoon", "cumin");
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code inside the ingredient function can see the factor binding from the outer function. But its local bindings, such as unit or ingredientAmount, are not visible in the outer function. &lt;br&gt;
Each local scope can also see all the local scopes that contain it, and all scopes can see the global scope. This approach to binding visibility is called lexical scoping.&lt;/p&gt;
&lt;h2&gt;
  
  
  Functions as Values
&lt;/h2&gt;

&lt;p&gt;It is possible to store a function value in a new binding, pass it as an argument to a function, and so on. Similarly, a binding that holds a function is still just a regular binding and can, if not constant, be assigned a new value, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let launchMissiles = function() {
  missileSystem.launch("now");
};
if (safeMode) {
  launchMissiles = function() {/* do nothing */};
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Declaration Notation
&lt;/h2&gt;

&lt;p&gt;There is a slightly shorter way to create a function binding. When the function keyword is used at the start of a statement, it works differently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function square(x) {
  return x * x;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function declarations are not part of the regular top-to-bottom flow of control.They are conceptually moved to the top of their scope and can be used by all the code in that scope. This is sometimes useful because it offers the freedom to order code in a way that seems meaningful, without worrying about having to define all functions before they are used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow functions
&lt;/h2&gt;

&lt;p&gt;An arrow function expression is a compact alternative to a traditional function expression, but is limited and can't 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
function bob (a){
  return a + 100;
}

// Arrow Function
let bob = a =&amp;gt; a + 100;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Call Stack
&lt;/h2&gt;

&lt;p&gt;The way control flows through functions is somewhat involved. Let’s take a closer look at it. Here is a simple program that makes a few function calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet(who) {
  console.log("Hello " + who);
}
greet("Harry");
console.log("Bye");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A run through this program goes roughly like this: the call to greet causes control to jump to the start of that function (line 2). The function calls console.log, which takes control, does its job, and then returns control to line 2. There it reaches the end of the greet function, so it returns to the place that called it, which is line 4. The line after that calls console.log again. After that returns, the program reaches its end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional Arguments
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function square(x) { return x * x; }
console.log(square(4, true, "hedgehog"));
// → 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In simple words, the extra arguments are ignored and just returns the value which it demands. &lt;br&gt;
JavaScript is extremely broad-minded about the number of arguments you pass to a function. If you pass too many, the extra ones are ignored. If you pass too few, the missing parameters get assigned the value undefined.&lt;/p&gt;

&lt;p&gt;The downside of this is that it is possible—likely, even—that you’ll accidentally pass the wrong number of arguments to functions. And no one will tell you about it.&lt;/p&gt;

&lt;p&gt;The upside is that this behavior can be used to allow a function to be called with different numbers of arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function minus(a, b) {
  if (b === undefined) return -a;
  else return a - b;
}

console.log(minus(10));
// → -10
console.log(minus(10, 5));
// → 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Closure
&lt;/h2&gt;

&lt;p&gt;A closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function multiplier(factor) {
  return number =&amp;gt; number * factor;
}

let twice = multiplier(2);
console.log(twice(5));
// → 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example, multiplier is called and creates an environment in which its factor parameter is bound to 2. The function value it returns, which is stored in twice, remembers this environment. So when that is called, it multiplies its argument by 2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursion
&lt;/h2&gt;

&lt;p&gt;It is perfectly okay for a function to call itself, as long as it doesn’t do it so often that it overflows the stack. A function that calls itself is called recursive.&lt;/p&gt;

&lt;p&gt;Imperative approach(loop)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function countDownFrom(number) {
    for (let i = number; i &amp;gt; 0; i--) {
        console.log(i);
    }   
}

countDownFrom(5);
// 5
// 4
// 3
// 2
// 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recursive approach&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function countDownFrom(number) {
    if (number === 0) {
        return;
    }

    console.log(number);    
    countDownFrom(number - 1);
}

countDownFrom(5);
// 5
// 4
// 3
// 2
// 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Growing Functions
&lt;/h2&gt;

&lt;p&gt;writing a good function name that defines the code in it refers to growing functions. Function name that gives precise explanation is helpful to understand the code but don't write every bit of functionality you come across--you'll just be writing code that you never use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Functions and side Effects
&lt;/h2&gt;

&lt;p&gt;Functions can be divided into those that they called for their side effects and those that are called for their return values.(also possible to have both in same function).&lt;br&gt;
A pure function is a specific kind of value-producing function that not only has no side effects but also doesn’t rely on side effects from other code.&lt;br&gt;
When you are not sure that a pure function is working correctly, you can test it by simply calling it and know that if it works in that context, it will work in any context.&lt;/p&gt;

&lt;p&gt;Conclusion ⌛&lt;br&gt;
I hope you found these tips helpful. If you need any help please let me know in the comment section.&lt;/p&gt;

&lt;p&gt;👋 Thanks for reading, See you next time&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>5 Free React Courses To Learn In 2022, If You're Just Starting Out.</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Sun, 26 Dec 2021 15:36:29 +0000</pubDate>
      <link>https://dev.to/pranish07/5-free-react-courses-to-learn-in-2022-if-youre-just-starting-out-4pne</link>
      <guid>https://dev.to/pranish07/5-free-react-courses-to-learn-in-2022-if-youre-just-starting-out-4pne</guid>
      <description>&lt;p&gt;1:  Learn React for free&lt;/p&gt;

&lt;p&gt;11 hour-long course, completely free from &lt;a class="mentioned-user" href="https://dev.to/bobziroll"&gt;@bobziroll&lt;/a&gt; . &lt;br&gt;
It contains 140+ interactive coding challenges and 9 projects! Best to begin with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrimba.com/learn/learnreact"&gt;https://scrimba.com/learn/learnreact&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2: 30 days of react&lt;br&gt;
Beginner friendly and easy to understand with projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Asabeneh/30-Days-Of-React"&gt;https://github.com/Asabeneh/30-Days-Of-React&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3: The Beginner's Guide to React&lt;/p&gt;

&lt;p&gt;No BS, React only course, working with a single HTML file through all the 28 lessons. &lt;a class="mentioned-user" href="https://dev.to/kentcdodds"&gt;@kentcdodds&lt;/a&gt; is my favorite teacher in the React community. Check out his other courses, newsletter, etc you won't regret it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://egghead.io/courses/the-beginner-s-guide-to-react"&gt;https://egghead.io/courses/the-beginner-s-guide-to-react&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4: Develop Accessible Web Apps with React &lt;br&gt;
The instructor is an expert in creating accessible React applications. This course will give you a concrete process for testing, refactoring, and building your applications with accessibility in mind.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://egghead.io/courses/develop-accessible-web-apps-with-react"&gt;https://egghead.io/courses/develop-accessible-web-apps-with-react&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5:  Build a Web App with React&lt;/p&gt;

&lt;p&gt;A free, 5-part video course with interactive code examples that will help you learn React from glitch. &lt;br&gt;
&lt;a href="https://blog.glitch.com/post/react-starter-kit"&gt;https://blog.glitch.com/post/react-starter-kit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion ⌛&lt;br&gt;
I hope you found these tips helpful. If you need any help please let me know in the comment section.&lt;/p&gt;

&lt;p&gt;👋 Thanks for reading, See you next time&lt;/p&gt;

</description>
      <category>react</category>
      <category>career</category>
      <category>100daysofcode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Eloquent JavaScript (Part I: Chapter 1/values, types and Operators)</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Sun, 26 Dec 2021 13:27:31 +0000</pubDate>
      <link>https://dev.to/pranish07/eloquent-javascript-part-i-chapter-1values-types-and-operators-319</link>
      <guid>https://dev.to/pranish07/eloquent-javascript-part-i-chapter-1values-types-and-operators-319</guid>
      <description>&lt;p&gt;In this post, we will learn about: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Values&lt;/li&gt;
&lt;li&gt;Numbers&lt;/li&gt;
&lt;li&gt;Special Characters&lt;/li&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;Unary Operators and binary Operators&lt;/li&gt;
&lt;li&gt;Boolean values&lt;/li&gt;
&lt;li&gt;Comparison&lt;/li&gt;
&lt;li&gt;Logical Operators&lt;/li&gt;
&lt;li&gt;Empty Values&lt;/li&gt;
&lt;li&gt;Automatic type Conversion&lt;/li&gt;
&lt;li&gt;Short circuiting of Logical Operators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Values&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
To be able to work with large quantities of bits without getting lost, we must separate them into chunks that represent pieces of information. In a JavaScript environment, those chunks are called values.Every value has a type that determines its role. Some values are numbers, some values are pieces of text, some values are functions, and so on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Numbers&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
values of the number type are numeric values.  for a number of 16, it will cause the bit pattern for the number 16 to come to existence.&lt;br&gt;
JavaScript uses 64 bits to store a single values. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Arithmetic&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
Main thing to do with arithmetic is numbers&lt;br&gt;
10+20*3 &lt;br&gt;
first the computer uses 20*3 and then it adds with the rest. to make the addition first we use parenthesis. &lt;br&gt;
(10+20)&lt;em&gt;3 //now first adds then multiply&lt;br&gt;
the computer solves in this order /&lt;/em&gt;+- .i.e. division, multiplication, addition and then subtraction. &lt;br&gt;
There's also another one i.e. %.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Special Numbers&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
There are only three special values in JavaScript.&lt;br&gt;
first two are infinty and - infinity and the 3rd one is NaN which stands for not a number. &lt;br&gt;
if you try to calculate 0/0 or infinity - infinity etc. , you'll get NaN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strings&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
anything inside quotes are strings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"hello this is a string"

"hello \n this is a string"
Output: 
hello
this is a string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;/t is a tabline character&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(`half of 100 is ${100 / 2}`)
output: half of 100 is 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Unary Operators&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
Operators that use one values are called unary operators.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(typeof 4.5)
// → number
console.log(typeof "x")
// → string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;operators that use two values are called binary operators&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(- (10 - 2))
// → -8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Boolean Value&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
JavaScript produce two boolean values : true and false &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparison&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(3 &amp;gt; 2)
// → true
console.log(3 &amp;lt; 2)
// → false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The way strings are ordered in roughly alphabetic.When comparing strings, JavaScript goes over the characters from left to right, comparing the Unicode codes one by one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"a"&amp;lt;"b"&amp;lt;"c"&amp;lt;"d" etc.&lt;/li&gt;
&lt;li&gt;"A"&amp;lt;"a"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is only one value in JavaScript that is not equal to itself, and that is NaN (“not a number”).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(NaN == NaN)
// → false 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;==,!=,&amp;lt;,&amp;gt;,&amp;lt;=,&amp;gt;= are used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logical Operators&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
JavaScript supports three logical operators: and , or , not&lt;br&gt;
And(&amp;amp;&amp;amp;), OR(||), not(!)&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(true&amp;amp;&amp;amp;false) //false
console.log(true||false) //true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ternary operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(true ? 1 : 2);
// → 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Empty values&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
There are two special valus: null and undefined The difference in meaning between undefined and null is an accident of JavaScript’s design, and it doesn’t matter most of the time. In cases where you actually have to concern yourself with these values, I recommend treating them as mostly interchangeable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Type Conversion&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(8 * null) //null becomes zero
// → 0
console.log("5" - 1)
// → 4
console.log("5" + 1) //concatenate
// → 51
console.log("five" * 2) //string and a number results Not a number(Nan)
// → NaN
console.log(false == 0)
// → true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When an operator is applied to the “wrong” type of value, JavaScript will quietly convert that value to the type it needs, using a set of rules that often aren’t what you want or expect. This is called type coercion&lt;/p&gt;

&lt;p&gt;I recommend using the three-character comparison operators defensively to prevent unexpected type conversions from tripping you up. But when you’re certain the types on both sides will be the same, there is no problem with using the shorter operators.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short-circuiting of logical operators&lt;/strong&gt; &lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logical operators &amp;amp;&amp;amp; and || handle values of different types in a peculiar way. They will convert the value on their left side to Boolean type in order to decide what to do, but depending on the operator and the result of that conversion, they will return either the original left-hand value or the right-hand value.&lt;/p&gt;

&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(null || "user")
// → user
console.log("Agnes" || "user")
// → Agnes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the initial value can be converted to false, you’ll get the replacement instead. The rules for converting strings and numbers to Boolean values state that 0, NaN, and the empty string ("") count as false, while all the other values count as true. So 0 || -1 produces -1, and "" || "!?" yields "!?".&lt;/p&gt;

&lt;p&gt;The &amp;amp;&amp;amp; operator works similarly but the other way around. When the value to its left is something that converts to false, it returns that value, and otherwise it returns the value on its right.&lt;/p&gt;

&lt;p&gt;Another important property of these two operators is that the part to their right is evaluated only when necessary. In the case of true || X, no matter what X is—even if it’s a piece of program that does something terrible—the result will be true, and X is never evaluated. The same goes for false &amp;amp;&amp;amp; X, which is false and will ignore X. This is called short-circuit evaluation.&lt;/p&gt;

&lt;p&gt;Conclusion ⌛&lt;br&gt;
I hope you found these tips helpful. If you need any help please let me know in the comment section.&lt;/p&gt;

&lt;p&gt;👋 Thanks for reading, See you next time&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Eloquent JavaScript (Part I : Chapter 2/Program Structure)</title>
      <dc:creator>Pranish Shrestha</dc:creator>
      <pubDate>Sun, 26 Dec 2021 12:22:03 +0000</pubDate>
      <link>https://dev.to/pranish07/eloquent-javascript-part-i-chapter-2program-structure-33cp</link>
      <guid>https://dev.to/pranish07/eloquent-javascript-part-i-chapter-2program-structure-33cp</guid>
      <description>&lt;p&gt;As JavaScript can work in most of the fields like web development, mobile apps, desktop apps etc. It is a vital programming language to day to learn.&lt;br&gt;
&lt;em&gt;This blog is inspired by a book Eloquent JavaScript&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What you will learn in this post&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expressions and statements&lt;/li&gt;
&lt;li&gt;Bindings&lt;/li&gt;
&lt;li&gt;Binding Names&lt;/li&gt;
&lt;li&gt;the environment&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;console.log function&lt;/li&gt;
&lt;li&gt;return value&lt;/li&gt;
&lt;li&gt;control flow&lt;/li&gt;
&lt;li&gt;conditional execution (if, else, if else)&lt;/li&gt;
&lt;li&gt;loops(while, do-while, for)&lt;/li&gt;
&lt;li&gt;Indenting Code&lt;/li&gt;
&lt;li&gt;Breaking out of a loop&lt;/li&gt;
&lt;li&gt;Updating Bindings Succinctly&lt;/li&gt;
&lt;li&gt;Dispatching on available with switch &lt;/li&gt;
&lt;li&gt;Capitalization&lt;/li&gt;
&lt;li&gt;Comments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expressions and Statements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A fragment of code that produces a value is called an expression.Expression is a piece of code that resolves to a value. Example: const number = 5; 5 is an expression and the whole const number = 5 is an statement.
Programs build statements which themselves sometimes is made out of statements and sometimes expressions contains by some other small expressions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bindings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We know that new values can be made by old values and if new values aren't used immediately then it can disappear again. To catch and hold values , JavaScript Provides a thing called Binding or a variable. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let today = 'day';
 console.log (today);
//day

today ='night';
console.log(today);
//night
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Binding doesn't contain the values , they grasp them with var, let, const.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binding Names&lt;/strong&gt;&lt;br&gt;
Rules for writing names : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;can include numbers but cannot start with number eg: hello123 is good but 123hello is not accepted. &lt;/li&gt;
&lt;li&gt;may include $ and underScore(_) but except no other are taken. No Spaces are used.
-binding names or variable names cannot be used of the keywords eg : break case catch class const continue debugger default delete do else enum export extends false finally for
function if implements import interface in instanceof let
new package private protected public return static super
switch this throw true try typeof var void while with yield&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don’t worry about memorizing this list. When creating a binding produces an unexpected syntax error, see whether you’re trying to define a reserved word.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The collection of bindings and their values that exist at a given time is called the environment.When a program starts up, this environment is not empty. It always contains bindings that are part of the language standard, and most of the time, it also has bindings that provide ways to interact with the surrounding system. For example, in a browser, there are functions to interact with the currently loaded website and to read mouse and keyboard input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;functions&lt;/strong&gt;&lt;br&gt;
functions are a piece of a program wrapped in a value. Values are given to a function called arguments. &lt;br&gt;
example:&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() {
...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;console.log function&lt;/strong&gt;&lt;br&gt;
In the javascript we use console.log function to see what the output has come. It cannot be seen in the viewing area of the browser but can be see in the inspect of the browsers. f12 on windows and command-option-I on mac. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Return Value&lt;/strong&gt;&lt;br&gt;
When a function produces a value, it is said to return a value.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; console.log(Math.max(2,4))
//4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Control Flow&lt;/strong&gt;&lt;br&gt;
In more than one statement, the statements are executed as if there are a story from top to bottom. &lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let num = number(prompt("Pick a number"))
console.log("your number is " + num)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conditional execution&lt;/strong&gt;&lt;br&gt;
 if there comes a choice then this execution can be used: &lt;br&gt;
  &lt;em&gt;if condition&lt;/em&gt;&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(1+1=2) console.log("Its true")
//Its true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if 1+2 isnt 2 then the console wouldnt have worked. &lt;br&gt;
for multiple choices example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let num = Number(prompt("Pick a number"));

if (num &amp;lt; 10) {
  console.log("Small");
} else if (num &amp;lt; 100) {
  console.log("Medium");
} else {
  console.log("Large");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Loops&lt;/strong&gt;&lt;br&gt;
to do a repeated work &lt;br&gt;
 &lt;em&gt;While loop&lt;/em&gt;&lt;br&gt;
we need is a way to run a piece of code multiple times. This form of control flow is called a loop.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let number = 0;
while (number &amp;lt;= 12) {
  console.log(number);
  number = number + 2;
}
// → 0
// → 2
//   … etcetera
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;do while&lt;/em&gt;&lt;br&gt;
In this loop atleast the loop will run atleast once.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let yourName;
do {
  yourName = prompt("Who are you?");
} while (!yourName);
console.log(yourName);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;for loop&lt;/em&gt;&lt;br&gt;
 example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for( var i=0;i&amp;lt;5;i++){
...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Indenting Code&lt;/strong&gt;&lt;br&gt;
Many coders uses tabs to indent their code to look nice and easier to read. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breaking out of a loop&lt;/strong&gt;&lt;br&gt;
To prevent from the loop that will run continuously so the break statement is used. &lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(let number=15; number=number+1){
  if (number%7==0){
console.log(number);
break;
}
}
//21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imagine if the break statement wasn't here then the loop would've run infinite times so to prevent it, the break statement is used and if there want to continue for the other loops then the continue statement is used. continue;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updating bindings Succinctly&lt;/strong&gt;&lt;br&gt;
(succinctly means brief or to the point)&lt;br&gt;
 Instead of number =number +1, we can also write number+=1 or number++ or number--. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dispatching on a value with switch&lt;/strong&gt;&lt;br&gt;
Instead of if condition to go into a decision. switch is more preferred.&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;switch (prompt("What is the weather like?")) {
  case "rainy":
    console.log("Remember to bring an umbrella.");
    break;
  case "sunny":
    console.log("Dress lightly.");
  case "cloudy":
    console.log("Go outside.");
    break;
  default:
    console.log("Unknown weather type!");
    break;
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Capitalization&lt;/strong&gt;&lt;br&gt;
There are 5 types to write a variable name in JS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hellopeopleoftheworld
hello_people_of_the_world
HelloPeopleOfTheWorld
helloPeopleOfTheWorld
HELLO_PEOPLE_OF_THE_WORLD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;1st one is hard to read. 2nd one is difficult to write the underscore. The effective way to write in a JavaScript is the 4th one: capitalizing every initials of the word except the first word;it is also called camelCase. the fifth one is basically used to define constants. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;br&gt;
// is used for single line comment and /**/ is used for multiple line comment.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// this is a good code
/*this code contains
alot of defining terms
to understand
*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Conclusion ⌛&lt;br&gt;
I hope you found these tips helpful. If you need any help please let me know in the comment section.&lt;/p&gt;

&lt;p&gt;👋 Thanks for reading, See you next time&lt;/p&gt;

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