<?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: Mohan Mogi</title>
    <description>The latest articles on DEV Community by Mohan Mogi (@mohan_mogi_61a3367e66b67c).</description>
    <link>https://dev.to/mohan_mogi_61a3367e66b67c</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3756893%2F42392817-0085-43da-a370-04eacb314473.png</url>
      <title>DEV Community: Mohan Mogi</title>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohan_mogi_61a3367e66b67c"/>
    <language>en</language>
    <item>
      <title>useMemo Hook in React</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Wed, 10 Jun 2026 07:01:51 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/usememo-hook-in-react-1ka8</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/usememo-hook-in-react-1ka8</guid>
      <description>&lt;p&gt;useMemo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;useMemo is a React Hook used for performance optimization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It returns a memoized value by storing the result of an expensive calculation in memory (cache) and reusing it during rerenders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React recalculates the value only when one of its dependencies changes, helping avoid unnecessary calculations and improve application performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;syntax:&lt;br&gt;
const memoizedValue = useMemo(() =&amp;gt; {&lt;br&gt;
  return calculation;&lt;br&gt;
}, [dependencies]);&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi75gzezcfoo3k9iecnbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi75gzezcfoo3k9iecnbk.png" alt=" " width="476" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0nhlzgqpricgfkg3m6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0nhlzgqpricgfkg3m6m.png" alt=" " width="378" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>useRef Hook</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Tue, 09 Jun 2026 08:01:03 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/useref-hook-2169</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/useref-hook-2169</guid>
      <description>&lt;p&gt;useRef Hook:&lt;br&gt;
useRef is a React Hook.Access and manipulate DOM elements directly.&lt;br&gt;
Store values without causing a component re-render.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
import { useRef } from "react";&lt;/p&gt;

&lt;p&gt;function App() {&lt;br&gt;
  const inputRef = useRef(null);&lt;/p&gt;

&lt;p&gt;return ;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2iqw74bxa8atge5m20sl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2iqw74bxa8atge5m20sl.png" alt=" " width="480" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapsnfti5im8pcbqqegzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapsnfti5im8pcbqqegzg.png" alt=" " width="797" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React useReducer Explained with Simple Examples</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Fri, 05 Jun 2026 07:30:15 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/react-usereducer-explained-with-simple-examples-43jg</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/react-usereducer-explained-with-simple-examples-43jg</guid>
      <description>&lt;p&gt;useReducer Hook:&lt;br&gt;
The useReducer Hook is similar to the useState Hook.Track of multiple pieces of state that rely on complex logic, useReducer may be useful.&lt;/p&gt;

&lt;p&gt;Syntax&lt;br&gt;
The useReducer Hook accepts three arguments.&lt;/p&gt;

&lt;p&gt;useReducer(reducer, initialState, init)&lt;/p&gt;

&lt;p&gt;Understanding the Parameters and Return Values of useReducer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;reducer&lt;br&gt;
The reducer is a function that defines how the state should change in response to an action. It receives the current state and an action object as arguments and returns the next state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;initialState&lt;br&gt;
The initialState is the value used to determine the initial state of the reducer. It can be any data type, such as a number, object, array, or string.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.dispatch&lt;br&gt;
The dispatch function is returned by useReducer and is used to send actions to the reducer. Whenever an action is dispatched, React executes the reducer, calculates the new state.The action object typically contains a type property and may include additional data.&lt;/p&gt;

&lt;p&gt;4.state&lt;br&gt;
The state value represents the current state managed by the reducer. It starts with the initial state and updates whenever an action is dispatched.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f5z76sld77f3c0265ko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f5z76sld77f3c0265ko.png" alt=" " width="561" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdq527suparwf7sdt6mch.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdq527suparwf7sdt6mch.png" alt=" " width="434" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Hooks Explained in Simple Terms</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Tue, 02 Jun 2026 10:28:11 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/react-hooks-explained-in-simple-terms-3gnf</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/react-hooks-explained-in-simple-terms-3gnf</guid>
      <description>&lt;p&gt;React Hooks: &lt;br&gt;
Hooks are built-in React functions that allow Functional Components to use React features such as state management, lifecycle methods, context, references, and performance optimizations without writing Class Components.Hooks were introduced in React 16.8.&lt;/p&gt;

&lt;p&gt;Why Use Hooks?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reusing stateful logic between components&lt;/li&gt;
&lt;li&gt;Managing complex component lifecycle code&lt;/li&gt;
&lt;li&gt;Reducing the need for Class Components&lt;/li&gt;
&lt;li&gt;Making components simpler and easier to understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before Hooks, Functional Components could only receive props and render UI. They could not manage state or lifecycle behavior. Hooks changed that.&lt;/p&gt;

&lt;p&gt;1.useState Hook:&lt;br&gt;
   The React useState Hook allows us to track state in a function component.State generally refers to data or properties that need to be tracking in an application.&lt;/p&gt;

&lt;p&gt;Import useState&lt;br&gt;
To use the useState Hook, first need to import it into component.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
At the top of component, import the useState Hook.&lt;br&gt;
import { useState } from "react";&lt;/p&gt;

&lt;p&gt;useState accepts an initial state and returns two values:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*The current state.
*A function that updates the state.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;import { useState } from "react";&lt;/p&gt;

&lt;p&gt;function FavoriteColor() {&lt;br&gt;
  const [color, setColor] = useState("red");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;explanation;&lt;br&gt;
The first value, color, is current state.&lt;br&gt;
The second value, setColor, is the function that is used to update  state.&lt;/p&gt;

&lt;p&gt;Read State explample:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycebf4twjfjhuta7yvi2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycebf4twjfjhuta7yvi2.png" alt=" " width="435" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgvl4k997y94lkakct86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwgvl4k997y94lkakct86.png" alt=" " width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Update State&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07tu355tll999h716jui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07tu355tll999h716jui.png" alt=" " width="437" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44itaf2x89lp6e9d92w3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44itaf2x89lp6e9d92w3.png" alt=" " width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.useEffect Hook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The useEffect Hook allows  to perform side effects in  components.&lt;/li&gt;
&lt;li&gt;Some examples of side effects are: fetching data, directly updating the DOM, and timers.&lt;/li&gt;
&lt;li&gt;useEffect accepts two arguments. The second argument is optional.
useEffect(, )&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding useEffect in React:</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Fri, 29 May 2026 08:05:09 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-useeffect-in-react-18cn</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-useeffect-in-react-18cn</guid>
      <description>&lt;p&gt;useEffect:&lt;br&gt;
useEffect is a React Hook that lets you perform side effects in a functional component.&lt;br&gt;
Common side effects are:&lt;br&gt;
Fetching data from an API,Updating the document title,Setting timers (setInterval, setTimeout),Adding event listeners,Accessing local storage.useEffect accepts two arguments. The second argument is optional.useEffect(, ).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding React Hooks with Practical Examples</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Thu, 28 May 2026 07:25:51 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-react-hooks-with-practical-examples-47ml</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-react-hooks-with-practical-examples-47ml</guid>
      <description>&lt;p&gt;what is a hook in react?&lt;br&gt;
   A Hook is a special React function that allows functional components to use React features such as state, lifecycle behavior, refs, and context without using class components.&lt;br&gt;
   They provide a more direct API to React concepts like props, state, context, refs, and lifecycle.&lt;br&gt;
   Before Hooks, state and lifecycle methods could only be used in class components.&lt;br&gt;
   Hooks were introduced in React 16.8 to make functional components more powerful.&lt;/p&gt;

&lt;p&gt;1.React useState hook:&lt;br&gt;
   The react usestate hook allows us to track state in a functional components.&lt;br&gt;
   State generally refers to data or properties that need to be tracking in an application.&lt;br&gt;
   useState is a React Hook used to store and update data (state) in a functional component.&lt;/p&gt;

&lt;p&gt;syntax&lt;br&gt;
const [state, setState] = useState(initialValue);&lt;/p&gt;

&lt;p&gt;code&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wswc6p7zk8d2tfzqgtn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5wswc6p7zk8d2tfzqgtn.png" alt=" " width="436" height="253"&gt;&lt;/a&gt;&lt;br&gt;
output&lt;br&gt;
three times click button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfyv0ndnh5z069g29mds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfyv0ndnh5z069g29mds.png" alt=" " width="797" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How it works&lt;br&gt;
 Initial value:&lt;br&gt;
   count = 0&lt;/p&gt;

&lt;p&gt;When button is clicked:&lt;br&gt;
setCount(count + 1);&lt;/p&gt;

&lt;p&gt;Value becomes:&lt;br&gt;
  count = 1&lt;br&gt;
  count = 2&lt;br&gt;
  count = 3&lt;/p&gt;

&lt;p&gt;Why use useState?&lt;br&gt;
 React updates the screen whenever the state changes.Data changes, React automatically re-renders the component and updates the UI.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Closures in JavaScript: A Complete Beginner Guide</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Wed, 27 May 2026 06:20:41 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-closures-in-javascript-a-complete-beginner-guide-n39</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/understanding-closures-in-javascript-a-complete-beginner-guide-n39</guid>
      <description>&lt;p&gt;closure;&lt;br&gt;
 In Javascript,closure is a feature.Closure is an inner function is retains accces to the variables of its outer(enclosing) function,even after that outer function has finished executing.A closure is the combination of a function and the lexical environment in which it was declared.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdygrkslw3r1jgwcuftog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdygrkslw3r1jgwcuftog.png" alt=" " width="588" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8kdyekmdqm9xywo9h2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8kdyekmdqm9xywo9h2c.png" alt=" " width="299" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Explanation:&lt;br&gt;
Step 1: &lt;br&gt;
outerFunction() runs&lt;br&gt;
let count = 0;&lt;/p&gt;

&lt;p&gt;Variable count is created.&lt;/p&gt;

&lt;p&gt;Memory:&lt;/p&gt;

&lt;p&gt;count = 0&lt;/p&gt;

&lt;p&gt;Step 2: &lt;br&gt;
innerFunction is created&lt;br&gt;
function innerFunction() {&lt;br&gt;
  count++;&lt;br&gt;
  console.log("Count:", count);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;innerFunction uses count from its parent function.&lt;/p&gt;

&lt;p&gt;Step 3:&lt;br&gt;
 Return inner function&lt;br&gt;
return innerFunction;&lt;br&gt;
const counter = outerFunction();&lt;/p&gt;

&lt;p&gt;Now counter stores innerFunction.&lt;/p&gt;

&lt;p&gt;Normally outerFunction() would finish and remove its variables from memory.&lt;/p&gt;

&lt;p&gt;But because innerFunction still needs count, JavaScript keeps count alive.&lt;/p&gt;

&lt;p&gt;This is called Closure.&lt;/p&gt;

&lt;p&gt;Step 4:&lt;br&gt;
First call&lt;br&gt;
counter();&lt;/p&gt;

&lt;p&gt;Runs:&lt;/p&gt;

&lt;p&gt;count++;&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;count = 0&lt;/p&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;p&gt;count = 1&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;Count: 1&lt;/p&gt;

&lt;p&gt;flow view:&lt;br&gt;
outerFunction()&lt;br&gt;
      |&lt;br&gt;
count = 0&lt;br&gt;
      |&lt;br&gt;
return innerFunction&lt;br&gt;
      |&lt;br&gt;
counter()&lt;br&gt;
      |&lt;br&gt;
count = 1&lt;/p&gt;

&lt;p&gt;counter()&lt;br&gt;
      |&lt;br&gt;
count = 2&lt;/p&gt;

&lt;p&gt;counter()&lt;br&gt;
      |&lt;br&gt;
count = 3&lt;/p&gt;

&lt;p&gt;counter()&lt;br&gt;
      |&lt;br&gt;
count = 4&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript DOM Practice: Exercises for Beginners</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Wed, 29 Apr 2026 07:52:27 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/javascript-dom-practice-exercises-for-beginners-1hi1</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/javascript-dom-practice-exercises-for-beginners-1hi1</guid>
      <description>&lt;p&gt;1.Change the Text and style&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfykev0b60sh7biwgugv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfykev0b60sh7biwgugv.png" alt=" " width="639" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa2npaai8dzrbm6poxy6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa2npaai8dzrbm6poxy6x.png" alt=" " width="228" height="108"&gt;&lt;/a&gt;&lt;br&gt;
after click&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwhlqcvs8j635y8xp694s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwhlqcvs8j635y8xp694s.png" alt=" " width="198" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.toggle on off bulb&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayitbkqgct6w1p5kl44m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayitbkqgct6w1p5kl44m.png" alt=" " width="748" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapb8o3uxhjwv9cxryum1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapb8o3uxhjwv9cxryum1.png" alt=" " width="309" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qsmn198to20sbc84ijr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qsmn198to20sbc84ijr.png" alt=" " width="256" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.Count of the characters&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81l3o32egjtoqh6bfa1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81l3o32egjtoqh6bfa1p.png" alt=" " width="538" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrrbhga6uk3y6jrpynyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrrbhga6uk3y6jrpynyi.png" alt=" " width="727" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DOM Basic Interview Questions</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Tue, 28 Apr 2026 06:31:05 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/dom-basic-interview-questions-56n1</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/dom-basic-interview-questions-56n1</guid>
      <description>&lt;p&gt;1.What is dom?&lt;br&gt;
 Dom stands for&lt;br&gt;
 D - Document&lt;br&gt;
 O - Object&lt;br&gt;
 M - Model&lt;br&gt;
 Dom is a programming interface for html documents.It represents the page as a tree of objects,so JavaScript can manipulate structure, style, and content dynamically.&lt;/p&gt;

&lt;p&gt;2.What is difference between dom and html?&lt;br&gt;
 DOM&lt;br&gt;
 Dom  is a tree-like object model.Represents the current state for interaction.Dynamic; it updates in real-time.Manipulated by JavaScript to change the page.&lt;/p&gt;

&lt;p&gt;HTML&lt;br&gt;
 Html is a markup language.Defines the initial structure and content.Static; it doesn't change once sent.Written by developers, read by browsers.&lt;/p&gt;

&lt;p&gt;3.what is difference betweenand getelementbyid and queryselector?&lt;br&gt;
  getelementbyid:&lt;br&gt;
  Only ID strings (e.g., 'myID').Single element matching the ID.Faster directly accesses the element by ID.Faster; directly accesses the element by ID.&lt;/p&gt;

&lt;p&gt;queryselector&lt;br&gt;
  Any CSS selector (e.g., '#myID', '.myClass', 'div &amp;gt; p').The first element matching the selector.Slightly slower must parse CSS selectors.Available on document and any individual element.&lt;/p&gt;

&lt;p&gt;4.How to change the content of HTML elements&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmijinrg6itf6119jxjpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmijinrg6itf6119jxjpw.png" alt=" " width="589" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmu5fyxf98ygwtlgqfd0v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmu5fyxf98ygwtlgqfd0v.png" alt=" " width="230" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after click&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmxiwwd6rq0igzo6kurb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmxiwwd6rq0igzo6kurb.png" alt=" " width="237" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>interview</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Object &amp; Array scenario Questions</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Fri, 17 Apr 2026 06:22:32 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/object-array-scenario-questions-33nc</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/object-array-scenario-questions-33nc</guid>
      <description>&lt;p&gt;1.User profile update&lt;br&gt;
const user = {&lt;br&gt;
  name: "Vijay",&lt;br&gt;
  age:25,&lt;br&gt;
  email:"&lt;a href="mailto:vijay@gmail.com"&gt;vijay@gmail.com&lt;/a&gt;"&lt;br&gt;
};&lt;br&gt;
Update email and add anew property isActive = true.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feywu65wv8albdfo5pg0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feywu65wv8albdfo5pg0g.png" alt=" " width="800" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.Shopping Cart Total&lt;br&gt;
 const cart = [&lt;br&gt;
  {name: "shirt", price:500},&lt;br&gt;
  {name: "shoes", price:1500},&lt;br&gt;
  {name: "cap", price:300}&lt;br&gt;
];&lt;br&gt;
Calculate total price.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg11wwehu3lmndjjsqjg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg11wwehu3lmndjjsqjg.png" alt=" " width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.Find Speccific Object&lt;br&gt;
onst users = [&lt;br&gt;
  { name: "Vijay, age:25"},&lt;br&gt;
  { name: "Arun", age:30},&lt;br&gt;
  { name: "Kumar", age:28}&lt;br&gt;
];&lt;br&gt;
From an array of users,find the user whose name is "arun".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtady4s2urv5dtxfl0i1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhtady4s2urv5dtxfl0i1.png" alt=" " width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.count items in Object&lt;br&gt;
const fruits = {&lt;br&gt;
apple:2,&lt;br&gt;
banana: 5,&lt;br&gt;
mango: 3&lt;br&gt;
};&lt;br&gt;
fine the total number of fruits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg87cw3njcvi8je40solb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg87cw3njcvi8je40solb.png" alt=" " width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript Array Iteration methods;</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Thu, 16 Apr 2026 09:05:33 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/javascript-array-iteration-methods-4jmk</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/javascript-array-iteration-methods-4jmk</guid>
      <description>&lt;p&gt;Array Iteration Methods:&lt;br&gt;
JavaScript array iteration means the process of going through each element of an array one by one and performing some operation on it.&lt;/p&gt;

&lt;p&gt;Types of Array iteration Methods:&lt;br&gt;
1.Array forEach&lt;br&gt;
2.Array map()&lt;br&gt;
3.Array flatMap()&lt;br&gt;
4.Array filter()&lt;br&gt;
5.Array reduce()&lt;br&gt;
6.Array reduceRight()&lt;br&gt;
7.Array every()&lt;br&gt;
8.Array some()&lt;br&gt;
9.Array from()&lt;br&gt;
10.Array keys()&lt;br&gt;
11.Array entries()&lt;br&gt;
12.Array with()&lt;br&gt;
13.Array Spread (...)&lt;br&gt;
14.Array Rest (...) &lt;/p&gt;

&lt;p&gt;1.Array forEach:&lt;br&gt;
  This method calls a fuction (call back function) once for each array element.No return value.&lt;/p&gt;

&lt;p&gt;Syntax&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foawa7yapdxv9n0uaaz6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foawa7yapdxv9n0uaaz6s.png" alt=" " width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 Explanation:&lt;br&gt;
1)Run each element&lt;br&gt;
2)Runs the function&lt;br&gt;
3)Does not create a new array.&lt;/p&gt;

&lt;p&gt;2.Array map()&lt;br&gt;
  This method creates a new array by performing function on each array element.It's not execute the function for array elements without values.this method not change the original array.it"s create a duplicate array.&lt;br&gt;
the function takes 3 arguments:&lt;br&gt;
 The item value&lt;br&gt;
 The item index&lt;br&gt;
 The array.&lt;/p&gt;

&lt;p&gt;Syntax&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwh19c67mk4vk8byo8led.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwh19c67mk4vk8byo8led.png" alt=" " width="800" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 Explanation:&lt;br&gt;
1.Takes each value&lt;br&gt;
2.Applies logic&lt;br&gt;
3.Stores results in a new array.&lt;/p&gt;

&lt;p&gt;3.Array flatMap()&lt;br&gt;
  This method first maps all elements of an array and then creates a new array by flattening the array.&lt;br&gt;
syntax&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4czbzzgawngqeybj2ztd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4czbzzgawngqeybj2ztd.png" alt=" " width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 Explanation:&lt;br&gt;
1.First maps values&lt;br&gt;
2.Then flattens one level.&lt;/p&gt;

&lt;p&gt;4.Array filter()&lt;br&gt;
  This  method creates a new array with array elements that pass a test.&lt;br&gt;
The function takes 3 arguments:&lt;br&gt;
 The item value&lt;br&gt;
 The item index&lt;br&gt;
 The array itself&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F305unc26djcf0b6bb57j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F305unc26djcf0b6bb57j.png" alt=" " width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why javascript is single Threaded</title>
      <dc:creator>Mohan Mogi</dc:creator>
      <pubDate>Wed, 15 Apr 2026 05:24:02 +0000</pubDate>
      <link>https://dev.to/mohan_mogi_61a3367e66b67c/why-javascript-is-single-threaded-4okb</link>
      <guid>https://dev.to/mohan_mogi_61a3367e66b67c/why-javascript-is-single-threaded-4okb</guid>
      <description>&lt;p&gt;The Origin: Designed for the Browser:&lt;br&gt;
JavaScript was created by Brendan Eich in 1995 to run inside web browsers like Netscape Navigator.At that time, the goal was simple, Make web pages interactive (e.g., form validation, button clicks)To achieve this safely and simply, JavaScript was designed as:&lt;br&gt;
Single-threaded run one task at a time.&lt;/p&gt;

&lt;p&gt;Single-Threaded Mean?&lt;br&gt;
Single-threaded is Only one operation runs at a time&lt;br&gt;
No true parallel execution in the main thread.&lt;br&gt;
Example:&lt;br&gt;
console.log("A");&lt;br&gt;
console.log("B");&lt;br&gt;
console.log("C");&lt;br&gt;
Output:&lt;br&gt;
A&lt;br&gt;
B&lt;br&gt;
C&lt;/p&gt;

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