<?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: biplavmz</title>
    <description>The latest articles on DEV Community by biplavmz (@biplavmz).</description>
    <link>https://dev.to/biplavmz</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%2F1018367%2F064e3151-96b8-4619-b0de-3300d384cb00.jpg</url>
      <title>DEV Community: biplavmz</title>
      <link>https://dev.to/biplavmz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/biplavmz"/>
    <language>en</language>
    <item>
      <title>What is Illegal Shadowing</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Tue, 30 Apr 2024 19:36:06 +0000</pubDate>
      <link>https://dev.to/biplavmz/what-is-illegal-shadowing-1kek</link>
      <guid>https://dev.to/biplavmz/what-is-illegal-shadowing-1kek</guid>
      <description>&lt;p&gt;It is a Situation where a &lt;strong&gt;variable in a inner Scope **(such as Block,Function) **unintentionally Hide a variable for the same name in an outerScope&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;Example 1 :-&amp;gt;&lt;br&gt;
`var x = 10;&lt;/p&gt;

&lt;p&gt;function m1(){&lt;br&gt;
    console.log(x)&lt;br&gt;
    var x = 100;&lt;br&gt;
    console.log(x);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;m1();`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Variable Shadowing in Javascript</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Tue, 30 Apr 2024 18:24:33 +0000</pubDate>
      <link>https://dev.to/biplavmz/what-is-variable-shadowing-in-javascript-1ik4</link>
      <guid>https://dev.to/biplavmz/what-is-variable-shadowing-in-javascript-1ik4</guid>
      <description>&lt;p&gt;when variable Shadowing occur in which condition&lt;/p&gt;

&lt;p&gt;Variable Shadowing occurs when a variable Declare with a local Scope (such as in function or block level Scope)&lt;br&gt;
has the same name as a variable in the outerScope. &lt;br&gt;
as the result inner variable &lt;strong&gt;shadow&lt;/strong&gt; the &lt;strong&gt;outer variable&lt;/strong&gt; &lt;br&gt;
it will work for all (var,let,const)&lt;/p&gt;

&lt;p&gt;`var x = 10;;&lt;/p&gt;

&lt;p&gt;function m1(){&lt;br&gt;
    var x = 100; // inner variable will shadow the outer variable &lt;br&gt;
    console.log(x);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;m1();  // it will print 100;&lt;br&gt;
console.log(x);  // it will print 10`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>Recursion</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Mon, 06 Mar 2023 15:43:20 +0000</pubDate>
      <link>https://dev.to/biplavmz/recursion-2de4</link>
      <guid>https://dev.to/biplavmz/recursion-2de4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Recursion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recursion is the technique of making a function call itself.&lt;/p&gt;

&lt;p&gt;This technique provides a way to break complicated problems down into simple problems which are easier to solve.&lt;/p&gt;

&lt;p&gt;It is a feature used in creating a function that keeps calling itself but with a smaller input every consecutive time until the code's desired result from the start is achieved.&lt;/p&gt;

&lt;p&gt;Adding two numbers together is easy to do,&lt;br&gt;
but adding a range of numbers is more complicated.&lt;/p&gt;

&lt;p&gt;In the following example, recursion is used to add a range of numbers together by breaking it down into the simple task of adding two numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let count = 1;

function m1(number){
    if(count &amp;gt; number){
        return;
    }
    console.log("Hello World :- "+count);
    count++;
     m1(number);
}

m1(10);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>algorithms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What will the code below output to the console and why?</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Mon, 06 Mar 2023 08:28:58 +0000</pubDate>
      <link>https://dev.to/biplavmz/what-will-the-code-below-output-to-the-console-and-why-4e0g</link>
      <guid>https://dev.to/biplavmz/what-will-the-code-below-output-to-the-console-and-why-4e0g</guid>
      <description>&lt;p&gt;`(function (){ var a = b = 5; })();&lt;/p&gt;

&lt;p&gt;console.log("a define ? :- "+ (typeof a !== 'undefined')) console.log("b define ? :- "+ (typeof b !== 'undefined'))&lt;br&gt;
`&lt;br&gt;
Since both a and b are defined within the enclosing scope of the function&lt;/p&gt;

&lt;p&gt;most JavaScript developers would expect typeof a and typeof b to both be undefined in the above example.&lt;/p&gt;

&lt;p&gt;However, that is not the case. The issue here is that most developers incorrectly understand the statement var a = b = 3; to be shorthand for:&lt;/p&gt;

&lt;p&gt;`var b = 3;&lt;/p&gt;

&lt;p&gt;var a = b;`&lt;/p&gt;

&lt;p&gt;But in fact, var a = b = 3; is actually shorthand for:&lt;/p&gt;

&lt;p&gt;`b = 3;&lt;/p&gt;

&lt;p&gt;var a = b;`&lt;/p&gt;

&lt;p&gt;As a result (if you are not using strict mode), the output of the code snippet would be:&lt;br&gt;
`&lt;br&gt;
a defined? false&lt;/p&gt;

&lt;p&gt;b defined? true`&lt;/p&gt;

&lt;p&gt;But how can b be defined outside of the scope of the enclosing function? Well, since the statement var a = b = 3;&lt;/p&gt;

&lt;p&gt;is shorthand for the statements b = 3; and var a = b;, b ends up being a global variable (since it is not preceded by the var keyword) and is therefore still in scope even outside of the enclosing function.&lt;/p&gt;

&lt;p&gt;Note that, in strict mode (i.e., with use strict), the statement var a = b = 3; will generate a runtime error of ReferenceError: b is not defined, thereby avoiding any headfakes/bugs that might othewise result. (Yet another prime example of why you should use use strict as a matter of course in your code!)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>How to Avoid JavaScript Type Conversions (Type Coercion)</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Sat, 04 Mar 2023 14:28:06 +0000</pubDate>
      <link>https://dev.to/biplavmz/how-to-avoid-javascript-type-conversions-type-coercion-37ce</link>
      <guid>https://dev.to/biplavmz/how-to-avoid-javascript-type-conversions-type-coercion-37ce</guid>
      <description>&lt;p&gt;JavaScript performs implicit conversions between data types. Let’s find out how to avoid it.&lt;/p&gt;

&lt;p&gt;Have you ever experienced a scenario where certain value comparisons in JavaScript do not result in what you expected?&lt;/p&gt;

&lt;p&gt;`if([]){&lt;br&gt;
    console.log("working");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;if(0){&lt;br&gt;
    console.log("working for 0");&lt;br&gt;
} &lt;/p&gt;

&lt;p&gt;if([]==0){&lt;br&gt;
  console.log(true);&lt;br&gt;
}&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Even though []==0 results in true , the if condition has not executed according to that result. Ever wondered why that is?&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What are JavaScript Type Conversions?&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
it is simply the automatic conversion of values from one data type to another.&lt;br&gt;
This occurs because JavaScript is a weakly typed language.&lt;/p&gt;

&lt;p&gt;Use strict comparison (===) when comparing values we can Avoid JavaScript Type Conversions&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>news</category>
    </item>
    <item>
      <title>Hoisting</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Thu, 02 Mar 2023 17:37:38 +0000</pubDate>
      <link>https://dev.to/biplavmz/hoisting-32hp</link>
      <guid>https://dev.to/biplavmz/hoisting-32hp</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---XWDn7ZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipvtxkuxnnr4s87qunxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---XWDn7ZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipvtxkuxnnr4s87qunxd.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In JavaScript, a variable can be declared after it has been used.&lt;/p&gt;

&lt;p&gt;In other words; a variable can be used before it has been declared.&lt;/p&gt;

&lt;p&gt;`var x = 7;&lt;/p&gt;

&lt;p&gt;function m1(){&lt;br&gt;
    console.log("hello World");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;m1();&lt;br&gt;
console.log(x);&lt;/p&gt;

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

&lt;p&gt;hello World&lt;br&gt;
7`&lt;/p&gt;

&lt;p&gt;and IF we declare before assign than&lt;/p&gt;

&lt;p&gt;`m1();&lt;br&gt;
console.log(x);&lt;/p&gt;

&lt;p&gt;var x = 7;&lt;/p&gt;

&lt;p&gt;function m1(){&lt;br&gt;
    console.log("hello World");&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;hello World&lt;br&gt;
undefined`&lt;/p&gt;

&lt;p&gt;`m1();&lt;br&gt;
m2();&lt;/p&gt;

&lt;p&gt;function m1(){&lt;br&gt;
    console.log("hello data");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;const m2 = ()=&amp;gt;{&lt;br&gt;
    console.log("h2");&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;hello data&lt;/p&gt;

&lt;p&gt;m2();&lt;br&gt;
^&lt;/p&gt;

&lt;p&gt;ReferenceError: Cannot access 'm2' before initialization`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Read GitHub Code Like Pro</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Sat, 18 Feb 2023 08:48:14 +0000</pubDate>
      <link>https://dev.to/biplavmz/how-to-read-github-code-like-pro-1edm</link>
      <guid>https://dev.to/biplavmz/how-to-read-github-code-like-pro-1edm</guid>
      <description>&lt;p&gt;&lt;a href="https://youtube.com/shorts/yKPkR3u-BVg?feature=share" rel="noopener noreferrer"&gt;Check video&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>what is callback function in javascript</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Tue, 14 Feb 2023 17:33:26 +0000</pubDate>
      <link>https://dev.to/biplavmz/what-is-callback-function-in-javascript-1hpp</link>
      <guid>https://dev.to/biplavmz/what-is-callback-function-in-javascript-1hpp</guid>
      <description>&lt;ol&gt;
&lt;li&gt;a callback function is a function &lt;/li&gt;
&lt;li&gt;that is passed as an argument&lt;/li&gt;
&lt;li&gt;to another function and is intended to be called later in the execution of that function.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The purpose of a callback function is to
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;allow for asynchronous programming.&lt;/li&gt;
&lt;li&gt;where a function can be executed while other code is running,&lt;/li&gt;
&lt;li&gt;and then execute the callback function when it's finished.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Callback functions are commonly used in event handling,&lt;br&gt;
AJAX requests, and other asynchronous operations.&lt;/p&gt;

&lt;p&gt;Q. Interview Question  related to Callback functions&lt;/p&gt;

&lt;p&gt;Q1.Explain what a callback function is and provide a simple example&lt;/p&gt;

&lt;p&gt;A callback function is a function that is passed to another function as an argument and is executed after some operation has been completed.&lt;/p&gt;

&lt;p&gt;Below is an example of a simple callback function that logs to the console after some operations have been completed.&lt;/p&gt;

&lt;p&gt;`function modifyArray(arr, callback) {&lt;br&gt;
  // do something to arr here&lt;br&gt;
  arr.push(100);&lt;br&gt;
  // then execute the callback function that was passed&lt;br&gt;
  callback();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;var arr = [1, 2, 3, 4, 5];&lt;/p&gt;

&lt;p&gt;modifyArray(arr, function() {&lt;br&gt;
  console.log("array has been modified", arr);&lt;br&gt;
});`&lt;/p&gt;

&lt;p&gt;Google JavaScript Technical Interview (Callbacks, Promises, Await/Async)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Callbacks&lt;br&gt;
What is a Callback in JavaScript&lt;br&gt;
Callbacks in real Life&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Callbacks vs. ES6 Promises &amp;amp; Await / Async&lt;br&gt;
Why Promises&lt;br&gt;
What are Promises&lt;br&gt;
How Promises resolves Callback Hell&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why do we even need Callback in JavaScript?&lt;/p&gt;

&lt;p&gt;(&lt;a href="https://medium.com/developers-tomorrow/google-javascript-technical-interview-7a20accd6ddf"&gt;https://medium.com/developers-tomorrow/google-javascript-technical-interview-7a20accd6ddf&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/developers-tomorrow/google-javascript-technical-interview-7a20accd6ddf"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Higher-Order Components</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Thu, 09 Feb 2023 16:28:20 +0000</pubDate>
      <link>https://dev.to/biplavmz/higher-order-components-52a0</link>
      <guid>https://dev.to/biplavmz/higher-order-components-52a0</guid>
      <description>&lt;p&gt;A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React's compositional nature.&lt;/p&gt;

&lt;p&gt;Concretely, a higher-order component is a function that takes a component and returns a new component.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const EnhancedComponent = higherOrderComponent(WrappedComponent);&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Whereas a component transforms props into UI, a higher-order component transforms a component into another component.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;what is HigherOrder Function&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
higher order function is a function that it accepts a function as an arrugment &lt;br&gt;
HOCs basically incorporate the don't-repeat-yourself (DRY) principle of programming, which you've most likely come across at some point in your career as a software developer.&lt;/p&gt;

</description>
      <category>vibecoding</category>
    </item>
    <item>
      <title>static site generator</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Tue, 07 Feb 2023 18:59:52 +0000</pubDate>
      <link>https://dev.to/biplavmz/static-site-generator-173</link>
      <guid>https://dev.to/biplavmz/static-site-generator-173</guid>
      <description>&lt;p&gt;A static site generator is a tool that generates a full static HTML website based on raw data and a set of templates.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lodash</title>
      <dc:creator>biplavmz</dc:creator>
      <pubDate>Tue, 07 Feb 2023 18:23:56 +0000</pubDate>
      <link>https://dev.to/biplavmz/lodash-k3n</link>
      <guid>https://dev.to/biplavmz/lodash-k3n</guid>
      <description>&lt;p&gt;What is Lodash and why to use?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Lodash is a JavaScript library.&lt;/li&gt;
&lt;li&gt;It helps in working with arrays,strings,objects,numbers,etc.&lt;/li&gt;
&lt;li&gt;It provides us with various inbuilt functions.&lt;/li&gt;
&lt;li&gt;It uses a functional programming approach which that coding in JavaScript easier to understand because instead of writing repetitive functions, tasks can be accomplished with a single line of code.&lt;/li&gt;
&lt;li&gt;It also makes it easier to work with objects in JavaScript if they require a lot of manipulation to be done upon them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why Lodash?&lt;/p&gt;

&lt;p&gt;It provides various inbuilt functions for collections, arrays, to manipulate objects, and other utility methods that we can use directly instead of writing them from scratch. &lt;/p&gt;

&lt;p&gt;It makes it easier to iterate over the arrays, strings as well as objects. Its modular methods enable the creation of composite functions easier.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
