<?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: MurtazaBagwala07</title>
    <description>The latest articles on DEV Community by MurtazaBagwala07 (@murtazabagwala07).</description>
    <link>https://dev.to/murtazabagwala07</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%2F685888%2F89f1feaf-46eb-426f-904c-c5833cb8dd90.png</url>
      <title>DEV Community: MurtazaBagwala07</title>
      <link>https://dev.to/murtazabagwala07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/murtazabagwala07"/>
    <language>en</language>
    <item>
      <title>Polyfill and shim</title>
      <dc:creator>MurtazaBagwala07</dc:creator>
      <pubDate>Wed, 12 Jan 2022 10:35:14 +0000</pubDate>
      <link>https://dev.to/murtazabagwala07/polyfill-and-shim-1o25</link>
      <guid>https://dev.to/murtazabagwala07/polyfill-and-shim-1o25</guid>
      <description>&lt;p&gt;I will try to give a brief overview of what polyfill and shim is and why are they used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Polyfill"&gt;Polyfill &lt;/a&gt;&lt;/strong&gt;: It basically is a code that allows browser to support such feature which it is not capable of implementing on its own.&lt;br&gt;
Generally it refers to Javascript Library which implements the HTML5 or CSS web standard.&lt;/p&gt;

&lt;p&gt;For example, Math.floor(n) is a function that returns the largest integer less than or equal to a given number, e.g Math.floor(1.23) returns 1.&lt;/p&gt;

&lt;p&gt;In some (very outdated) JavaScript engines, there’s no Math.floor, so such code will not work.&lt;/p&gt;

&lt;p&gt;So how is this code supposed to work in those outdated JS engines?&lt;br&gt;
Thats Where polyfill comes in.&lt;/p&gt;

&lt;p&gt;It is a script that updates/adds new functions.It “fills in” the gap and adds missing implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Shim"&gt;Shim &lt;/a&gt;&lt;/strong&gt;: A shim is any piece of code that performs interception of an API call and provides a layer of abstraction. It isn't necessarily restricted to a web application or HTML5/CSS3.&lt;/p&gt;

&lt;p&gt;The idea here is to make it normal using certain APIs across different environments. So, if two browsers implement the same API differently, you could intercept the API calls in one of those browsers and make its behavior align with the other browser.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>JavaScript Variables and more </title>
      <dc:creator>MurtazaBagwala07</dc:creator>
      <pubDate>Sat, 14 Aug 2021 10:51:27 +0000</pubDate>
      <link>https://dev.to/murtazabagwala07/javascript-variables-and-more-46bo</link>
      <guid>https://dev.to/murtazabagwala07/javascript-variables-and-more-46bo</guid>
      <description>&lt;p&gt;JavaScript (JS) is a lightweight, interpreted compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages. In this blog I will discuss the variables used in JavaScript Language.&lt;/p&gt;

&lt;p&gt;Firstly to discuss what actually are variable ? Variables are used to store data values. They are used to contain values which can be used later in the program for different operations and algorithms. A variable can only contain one value at a time, which can be of any data type. Meaning either a string, number, boolean, array, object, function or null or undefined.&lt;/p&gt;

&lt;p&gt;Now, In JavaScript we have 3 keywords for variables, Const, var &amp;amp; let. &lt;br&gt;
While var was the OG variable declaration in JS, const and let were introduced with ES6.&lt;/p&gt;

&lt;p&gt;Var : Scope of var can be global or local depending on where is it declared. It means if any variable with var is declared outside function , it can be used throughout the program , while if it is declared inside the function it can only be used inside the function. &lt;/p&gt;

&lt;p&gt;Hoisting of Var : Basic meaning of hoist is to pull something up or lift , hoisting is basically a mechanism where declarations of Variables and functions move to top of the scope wherever they are declared before code execution starts.&lt;br&gt;
When var variables are hoisted to top they are initialized with value of "undefined".&lt;/p&gt;

&lt;p&gt;Const : Const variable keyword was introduced with ES6 in 2015.&lt;br&gt;
As the name of the keyword suggests const is used to define variables that are constant, it sounds a little bit oxymoronic but in other words we can say Const variables cannot be reassigned, if we declare a const array we can make changes in it but cannot reassign it. It also cannot be re-declared. Since const cannot be redeclared it has to initialized at the time of declaration .Const has a block scope which I will explain with use of a 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;const&lt;/span&gt; &lt;span class="nx"&gt;hello&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;murtaza&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hello&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;how&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// returns "how"&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;hello&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//returns "murtaza"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let : Just like const let is also a block scoped variable keyword. Let can be updated but it cannot be re-declared. Just like var and const , let declaration is hoisted to top , while var is initialized with "undefined" , const and let are not initialized,&lt;br&gt;
so if we try a to use a variable with let keyword without initializing it , it will give "Reference Error".&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;greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greeting&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;greeting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// it returns "error: Uncaught ReferenceError: Cannot access 'g' before initialization"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
