<?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: Visali Nedunchezhian</title>
    <description>The latest articles on DEV Community by Visali Nedunchezhian (@visali_nedunchezhian_ee73).</description>
    <link>https://dev.to/visali_nedunchezhian_ee73</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%2F3260046%2Fbb56190a-24a1-4739-acd0-9033b16fc917.jpg</url>
      <title>DEV Community: Visali Nedunchezhian</title>
      <link>https://dev.to/visali_nedunchezhian_ee73</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/visali_nedunchezhian_ee73"/>
    <language>en</language>
    <item>
      <title>React Hooks</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Sun, 24 Aug 2025 18:14:45 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/react-hooks-45pd</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/react-hooks-45pd</guid>
      <description>&lt;p&gt;&lt;strong&gt;React Hooks&lt;/strong&gt; are special functions that let you use React features (like state and lifecycle methods) inside functional components, without writing class components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useState&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;useState&lt;/strong&gt; hook is used to declare state variables in functional components. It allows us to read and update the state within the component.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [state, setState] = useState(initialState);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;state: The current value of the state.&lt;/li&gt;
&lt;li&gt;setState: A function used to update the state.&lt;/li&gt;
&lt;li&gt;initialState: The initial value of the state, which can be a primitive type or an object/array&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;useReducer: The useReducer hook is a more advanced state management hook used for handling more complex state logic, often involving multiple sub-values or more intricate state transitions.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [state, dispatch] = useReducer(reducer, initialState);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;state: The current state value.&lt;/li&gt;
&lt;li&gt;dispatch: A function used to dispatch actions that will update the state.&lt;/li&gt;
&lt;li&gt;reducer: A function that defines how the state should change based on the dispatched action.&lt;/li&gt;
&lt;li&gt;initialState: The initial state value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;useContext&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;useContext&lt;/strong&gt; hook in React is a powerful and convenient way to consume values from the React Context API in functional components. It allows functional components to access context values directly, without the need to manually pass props down through the component tree&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const contextValue = useContext(MyContext);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The useContext hook takes a context object (MyContext) as an argument and returns the current value of that context.&lt;/li&gt;
&lt;li&gt;The contextValue will hold the value provided by the nearest  in the component tree.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;useEffect:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;useEffect&lt;/strong&gt; hook in React is used to handle side effects in functional components. It allows you to perform actions such as data fetching, DOM manipulation, and setting up subscriptions, which are typically handled in lifecycle methods like componentDidMount or componentDidUpdate in class components.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
    // Side effect logic here
}, [dependencies]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;useEffect(() =&amp;gt; { ... }, [dependencies]); runs side effects after rendering.&lt;/li&gt;
&lt;li&gt;The effect runs based on changes in the specified dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;useLayoutEffect: The useLayoutEffect is used when we need to measure or manipulate the lawet before the browser paints, ensuring smooth transitions and no flickering.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useLayoutEffect(() =&amp;gt; {
  // Logic to manipulate layout or measure DOM elements
}, [dependencies]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;useInsertionEffect: The useInsertionEffect is designed for injecting styles early, especially useful for server-side rendering (SSR) or styling libraries, ensuring styles are in place before the component is rendered visually.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useInsertionEffect(() =&amp;gt; {
    // Logic to inject styles or manipulate stylesheets
}, [dependencies]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;useRef&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;useRef is a React Hook that lets you create a mutable reference object.&lt;/li&gt;
&lt;li&gt;It is often used to:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Access and control DOM elements directly.&lt;/li&gt;
&lt;li&gt;Store values that don’t cause re-render when updated.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const refName = useRef(initialValue);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Returns an object: { current: initialValue }&lt;/li&gt;
&lt;li&gt;The value inside current can be read or changed.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>ReactJS Functional Components</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Sun, 24 Aug 2025 17:22:37 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/reactjs-functional-components-3d86</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/reactjs-functional-components-3d86</guid>
      <description>&lt;p&gt;&lt;strong&gt;In ReactJS&lt;/strong&gt;, functional components are a core part of building user interfaces. They are simple, lightweight, and powerful tools for rendering UI and handling logic. Functional components can accept props as input and return JSX that describes what the component should render.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

function App() {
  const [message, setMessage] = useState("Hello World!");

  return (
    &amp;lt;div style={{ textAlign: "center", marginTop: "50px" }}&amp;gt;
      &amp;lt;h1&amp;gt;{message}&amp;lt;/h1&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; setMessage("Welcome to React!")}&amp;gt;
        Click Me!
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;

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

&lt;/div&gt;



&lt;p&gt;When a functional component receives input and is rendered, React uses props and updates the virtual DOM to ensure the UI reflects the current state.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Props:&lt;/strong&gt; Functional components receive input data through props, which are objects containing key-value pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing Props&lt;/strong&gt;: After receiving props, the component processes them and returns a JSX element that defines the component's structure and content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual DOM:&lt;/strong&gt; When the component is rendered, React creates a virtual DOM tree that represents the current state of the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-rendering:&lt;/strong&gt; If the component's props or state change, React updates the virtual DOM tree accordingly and triggers the component to re-render.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Functional Component with Props&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React, a functional component with props is a JavaScript function that receives an object called props as its argument. Props (short for “properties”) are used to pass data from a parent component to a child component.&lt;/p&gt;

&lt;p&gt;This allows components to be dynamic and reusable, as the data displayed can change based on what is passed in.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ReactDOM from 'react-dom';

// Functional component with props
function Greet(props) {
  return &amp;lt;h2&amp;gt;Hello, {props.name}!&amp;lt;/h2&amp;gt;;
}

// Rendering the component and passing a prop
ReactDOM.render(
  &amp;lt;Greet name="Aditi" /&amp;gt;,
  document.getElementById('root')
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, Aditi!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to Use ReactJS Functional Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functional components should be used whenever possible because they are simpler, easier to test, and more performant than class components. However, there are a few cases where functional components may not be suitable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stateful components:&lt;/strong&gt; Functional components cannot hold state on their own. Therefore, if you need to maintain state within your component, you may need to use a class component.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifecycle methods:&lt;/strong&gt; If you need to use lifecycle methods such as componentDidMount, componentDidUpdate, or componentWillUnmount, you will need to use a class component.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Node js installation</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Fri, 08 Aug 2025 17:27:43 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/node-js-installation-3eni</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/node-js-installation-3eni</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Download Node.js Installer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the official Node.js website: Node.js Download Page&lt;/li&gt;
&lt;li&gt;Choose the LTS version (recommended for stability).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Run the Installer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Double-click the .msi file.&lt;/li&gt;
&lt;li&gt;Accept the license agreement.&lt;/li&gt;
&lt;li&gt;Use default settings unless you have specific needs.&lt;/li&gt;
&lt;li&gt;Ensure the box for npm package manager is checked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Install Tools for Native Modules (Optional)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If prompted, allow installation of additional tools (like Python and Visual Studio Build Tools).&lt;/li&gt;
&lt;li&gt;This is useful for packages that require compilation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Finish Installation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click “Finish” once setup is complete.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Verify Installation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Command Prompt or PowerShell.&lt;/li&gt;
&lt;li&gt;Run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;• You should see version numbers confirming successful installation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Create a New React App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Open Your Terminal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use Command Prompt&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Run the Create React App Command&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npx runs the package without installing it globally.&lt;/li&gt;
&lt;li&gt;create-react-app sets up everything for you.&lt;/li&gt;
&lt;li&gt;my-app is your project folder name (you can change it).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Navigate into Your Project Folder&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Start the Development Server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compile your React app&lt;/li&gt;
&lt;li&gt;Open it in your default browser at &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Folder Structure Overview&lt;/strong&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%2Ffxj8zgoxs4ujfwxy12zp.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%2Ffxj8zgoxs4ujfwxy12zp.png" alt=" " width="718" height="26"&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;my-app/
├── node_modules/
├── public/
│   └── index.html
├── src/
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   └── reportWebVitals.js
├── .gitignore
├── package.json
├── README.md
└── yarn.lock / package-lock.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Frgox4q5o9mknw5okywwe.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%2Frgox4q5o9mknw5okywwe.png" alt=" " width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Callback Functions</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Thu, 07 Aug 2025 17:30:14 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/javascript-callback-functions-3lgn</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/javascript-callback-functions-3lgn</guid>
      <description>&lt;p&gt;&lt;strong&gt;JavaScript Callbacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A callback function is a function that is passed as an argument to another function and executed later.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function can accept another function as a parameter.&lt;/li&gt;
&lt;li&gt;Callbacks allow one function to call another at a later time.&lt;/li&gt;
&lt;li&gt;A callback function can execute after another function has finished.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet(name, callback) {
    console.log("Hello, " + name);
    callback();
}

function sayBye() {
    console.log("Goodbye!");
}

greet("vishali", sayBye);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, Ajay
Goodbye!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, sayBye() is passed as a callback to greet(), which executes after the greeting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Do Callbacks Work in JavaScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript executes code line by line (synchronously), but sometimes we need to delay execution or wait for a task to complete before running the next function. Callbacks help achieve this by passing a function that is executed later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Callbacks for Asynchronous Execution&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("Start");

setTimeout(function () {
    console.log("Inside setTimeout");
}, 2000);

console.log("End");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
End
Inside setTimeout  (after 2 seconds)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;setTimeout() is an asynchronous function that takes a callback to execute after 2 seconds.&lt;/li&gt;
&lt;li&gt;The rest of the code continues executing without waiting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where Are Callbacks Used?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Handling Asynchronous Operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Callbacks are widely used in&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API requests (fetching data)&lt;/li&gt;
&lt;li&gt;Reading files (Node.js file system)&lt;/li&gt;
&lt;li&gt;Event listeners (clicks, keyboard inputs)&lt;/li&gt;
&lt;li&gt;Database queries (retrieving data)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Callbacks in Functions Handling Operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a function needs to execute different behaviors based on input, callbacks make the function flexible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function calc(a, b, callback) {
    return callback(a, b);
}

function add(x, y) {
    return x + y;
}

function mul(x, y) {
    return x * y;
}

console.log(calc(5, 3, add));    
console.log(calc(5, 3, mul));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8
15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;calculate() receives two numbers and a function (add or multiply).&lt;/li&gt;
&lt;li&gt;The passed function is executed inside calculate().&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Callbacks in Event Listeners&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is event-driven, and callbacks handle user interactions like clicks and key presses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("myButton").addEventListener("click", function () {
    console.log("Button clicked!");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the anonymous function is a callback that runs when the button is clicked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Callbacks in API Calls (Fetching Data)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Callbacks are useful when retrieving data from APIs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function fetch(callback) {
    fetch("https://jsonplaceholder.typicode.com/todos/1")
        .then(response =&amp;gt; response.json())
        .then(data =&amp;gt; callback(data))
        .catch(error =&amp;gt; console.error("Error:", error));
}

function handle(data) {
    console.log("Fetched Data:", data);
}

fetch(handle);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;fetchData() gets data from an API and passes it to handleData() for processing.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>REACT Introduction</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Thu, 07 Aug 2025 17:08:47 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/react-introduction-3kd0</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/react-introduction-3kd0</guid>
      <description>&lt;p&gt;&lt;strong&gt;REACT&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React is a front-end JavaScript library.&lt;/li&gt;
&lt;li&gt;React was developed by the Facebook Software Engineer Jordan Walke.&lt;/li&gt;
&lt;li&gt;React is also known as React.js or ReactJS.&lt;/li&gt;
&lt;li&gt;React is a tool for building UI components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How does React Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React operates by creating an in-memory virtual DOM rather than directly manipulating the browser’s DOM. It performs necessary manipulations within this virtual representation before applying changes to the actual browser DOM.&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%2Fyc47dz6bv9wb8qzmf8h6.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%2Fyc47dz6bv9wb8qzmf8h6.png" alt=" " width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s how the process works:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Actual DOM and Virtual DOM&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initially, there is an Actual DOM(Real DOM) containing a div with two child elements: h1 and h2.&lt;/li&gt;
&lt;li&gt;React maintains a previous Virtual DOM to track the UI state before any updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Detecting Changes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When a change occurs (e.g., adding a new h3 element), React generates a New Virtual DOM.&lt;/li&gt;
&lt;li&gt;React compares the previous Virtual DOM with the New Virtual DOM using a process called reconciliation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Efficient DOM Update&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React identifies the differences (in this case, the new h3 element).&lt;/li&gt;
&lt;li&gt;Instead of updating the entire DOM, React updates only the changed part in the New Actual DOM, making the update process more efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Features of React&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React is one of the most demanding JavaScript libraries because it is equipped with a ton of features which makes it faster and production-ready. Below are the few features of React.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Virtual DOM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React uses a Virtual DOM to optimize UI rendering. Instead of updating the entire real DOM directly, React:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a lightweight copy of the DOM (Virtual DOM).&lt;/li&gt;
&lt;li&gt;Compares it with the previous version to detect changes (diffing).&lt;/li&gt;
&lt;li&gt;Updates only the changed parts in the actual DOM (reconciliation), improving performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Component-Based Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React follows a component-based approach, where the UI is broken down into reusable components. These components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can be functional or class-based.&lt;/li&gt;
&lt;li&gt;It allows code reusability, maintainability, and scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. JSX (JavaScript XML)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React usesJSX, a syntax extension that allows developers to write HTML inside JavaScript. JSX makes the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More readable and expressive.&lt;/li&gt;
&lt;li&gt;Easier to understand and debug.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. One-Way Data Binding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React uses one-way data binding, meaning data flows in a single direction from parent components to child components via props. This provides better control over data and helps maintain predictable behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. State Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React manages component state efficiently using the useState hook (for functional components) or this.state (for class components). State allows dynamic updates without reloading the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. React Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hooks allow functional components to use state and lifecycle features without needing class components. Common hooks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;useState: for managing local state.&lt;/li&gt;
&lt;li&gt;useEffect: for handling side effects like API calls.&lt;/li&gt;
&lt;li&gt;useContext: for global state management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. React Router&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React provides React Router for managing navigation in single-page applications (SPAs). It enables dynamic routing without requiring full-page reloads.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Synchronous and Asynchronous in JavaScript</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Mon, 04 Aug 2025 17:30:57 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/synchronous-and-asynchronous-in-javascript-3kbf</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/synchronous-and-asynchronous-in-javascript-3kbf</guid>
      <description>&lt;p&gt;JavaScript is known for its ability to handle both synchronous and asynchronous operations. Understanding how these two things work is important for writing efficient, responsive, and user-friendly applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Synchronous JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In synchronous programming, operations are performed one after the other, in sequence. So, basically each line of code waits for the previous one to finish before proceeding to the next. This means that the program executes in a predictable, linear order, with each task being completed before the next one starts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; In this example, we have shown the synchronous nature of JavaScript.&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("Hi");
console.log("Geek");
console.log("How are you?");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi
Geek
How are you?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code snippet, the first line of the code Hi will be logged first then the second line Geek will be logged and then after its completion, the third line will be logged How are you. So as we can see the codes work in a sequence. Every line of code waits for its previous one to get executed first and then it gets executed.&lt;/p&gt;

&lt;p&gt;In synchronous code, every statement waits for the previous one to finish before it runs. This is straightforward and easy to follow, but it has some drawbacks, especially when dealing with time-consuming tasks like fetching data from a server or reading a large file. If such a task is included in the sequence, it will block the execution of the rest of the code until it’s finished, leading to potential delays and a bad user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asynchronous JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asynchronous programming, on the other hand, allows multiple tasks to run independently of each other. In asynchronous code, a task can be initiated, and while waiting for it to complete, other tasks can proceed. This non-blocking nature helps improve performance and responsiveness, especially in web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; In this example, we have shown the Asynchronous nature of JavaScript.&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("Hi");

setTimeout(() =&amp;gt; {
    console.log("Geek");
}, 2000);

console.log("End");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi
End
Geek
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, what the code does is first it logs in Hi then rather than executing the setTimeout function it logs in End and then it runs the setTimeout function.&lt;/p&gt;

&lt;p&gt;At first, as usual, the Hi statement got logged in. As we use browsers to run JavaScript, there are the web APIs that handle these things for users. So, what JavaScript does is, it passes the setTimeout function in such web API and then we keep on running our code as usual. So it does not block the rest of the code from executing and after all the code its execution, it gets pushed to the call stack and then finally gets executed. This is what happens in asynchronous JavaScript.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Local Storage</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Mon, 04 Aug 2025 17:04:16 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/javascript-local-storage-35eo</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/javascript-local-storage-35eo</guid>
      <description>&lt;p&gt;&lt;strong&gt;JavaScript Local Storage&lt;/strong&gt; is a feature that allows you to store data in the user's browser persistently — the data doesn't get deleted when the browser is closed (unlike session storage).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Local Storage Methods&lt;/strong&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%2Fef87govz37f34x2ibv1k.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%2Fef87govz37f34x2ibv1k.png" alt=" " width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localStorage.setItem("username", "Adithi");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Get Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = localStorage.getItem("username");
console.log(user);  // Output: Adithi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Remove a Key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localStorage.removeItem("username");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clear All Storage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localStorage.clear();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Store Objects or Arrays&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since localStorage stores only strings, you need to convert objects/arrays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = { name: "Adithi", age: 21 };

// Save object
localStorage.setItem("user", JSON.stringify(user));

// Get object
let storedUser = JSON.parse(localStorage.getItem("user"));
console.log(storedUser.name);  // Output: Adithi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>HTML DOM Events</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Wed, 23 Jul 2025 11:02:45 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/html-dom-events-k07</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/html-dom-events-k07</guid>
      <description>&lt;p&gt;&lt;strong&gt;DOM Events&lt;/strong&gt; allow JavaScript to add event listener or event handlers to HTML elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;br&gt;
In HTML onclick is the event listener, myFunction is the event handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button onclick="myFunction()"&amp;gt;Click me&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In JavaScript click is the event, myFunction is the event handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;button.addEventListener("click", myFunction);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's a categorized list of the most common DOM event types:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mouse Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mouse events are DOM events that occur when a user interacts with the mouse—moving it, clicking, hovering, etc. These events let web pages respond to user behavior like clicking buttons, dragging items, or hovering over menus.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;click&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User clicks on an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dblclick&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User double-clicks on an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mousedown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse button is pressed down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mouseup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse button is released&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mousemove&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse is moved over an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mouseenter&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse enters an element (does &lt;strong&gt;not&lt;/strong&gt; bubble)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mouseleave&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse leaves an element (does &lt;strong&gt;not&lt;/strong&gt; bubble)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mouseover&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse is moved onto an element or its children&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mouseout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mouse is moved out of an element or its children&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;contextmenu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right-click opens the context menu&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Keyboard Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keyboard events are DOM events that occur when a user interacts with the keyboard—pressing or releasing keys. These events are essential for handling things like shortcuts, form navigation, games, and custom input behavior.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keydown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Key is pressed down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keyup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Key is released&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keypress&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Key is pressed (deprecated – use &lt;code&gt;keydown&lt;/code&gt;/&lt;code&gt;keyup&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Input and Form Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These events are specifically related to user interactions with form controls, like , , , and . They are used to capture user input, validate forms, and respond to changes in form fields.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;input&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User input changes (works with &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;change&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Value of element changes (e.g., after losing focus)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;submit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Form is submitted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;focus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element gains focus (does &lt;strong&gt;not&lt;/strong&gt; bubble)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;blur&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element loses focus (does &lt;strong&gt;not&lt;/strong&gt; bubble)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;focusin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element gains focus (bubbles)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;focusout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element loses focus (bubbles)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;reset&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Form is reset&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;UI Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;UI events (short for User Interface events) are a category of DOM events that are triggered by changes in the browser's user interface—not necessarily due to direct user input like clicks or key presses, but due to things like page loading, resizing, scrolling, and visibility changes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element (e.g., image, iframe) finishes loading&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;unload&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Page is unloaded (deprecated)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;resize&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Window is resized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scroll&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Element or window is scrolled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;error&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Error occurs while loading a file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
    <item>
      <title>HTML DOM (Document Object Model)</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Wed, 23 Jul 2025 10:36:54 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/html-dom-document-object-model-4f5p</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/html-dom-document-object-model-4f5p</guid>
      <description>&lt;p&gt;The HTML DOM (Document Object Model) is a programming interface for HTML and XML documents. It represents the structure of a web page as a tree of objects, so that programming languages like JavaScript can access and manipulate the content, structure, and style of a website dynamically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Concepts of the HTML DOM:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Document Structure
The DOM represents an HTML document as a tree of nodes:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Document → the root node&lt;/li&gt;
&lt;li&gt;Element nodes (like &lt;code&gt;&amp;lt;html&amp;gt;, &amp;lt;body&amp;gt;, &amp;lt;div&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Text nodes (text inside elements)&lt;/li&gt;
&lt;li&gt;Attribute nodes (like id, class)&lt;/li&gt;
&lt;/ul&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%2Fhx1t2k4anpswomshdzrb.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%2Fhx1t2k4anpswomshdzrb.png" alt=" " width="735" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Common DOM Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Used with JavaScript to interact with the page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- document.getElementById("myId");
- document.getElementsByClassName("myClass");
- document.querySelector("div &amp;gt; p");
- document.createElement("div");
- element.appendChild(newElement);
- element.removeChild(childElement);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. DOM Events&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("btn").addEventListener("click", function() {
  alert("Button clicked!");
});

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Changing the DOM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can modify elements using properties like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;element.innerHTML = "New content";
element.style.color = "red";
element.setAttribute("class", "highlight");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>JavaScript Scope</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Tue, 22 Jul 2025 10:28:27 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/javascript-scope-3hi9</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/javascript-scope-3hi9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Scoping in JavaScript&lt;/strong&gt; refers to the accessibility or visibility of variables, functions, and objects in some particular part of your code during runtime. JavaScript has several types of scope:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Global Scope&lt;/li&gt;
&lt;li&gt;Function Scope&lt;/li&gt;
&lt;li&gt;Block Scope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Global Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables declared outside of any function or block are in the global scope and are accessible anywhere in the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let globalVar = "I am global";

function test() {
  console.log(globalVar); // Accessible here
}

test();
console.log(globalVar); // Also accessible here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;** 2. Function Scope**&lt;/p&gt;

&lt;p&gt;Variables declared inside a function are only accessible within that function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function example() {
  let localVar = "I am local";
  console.log(localVar); // Accessible
}

example();
console.log(localVar); // ❌ ReferenceError
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Block Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables declared with let or const inside a block ({}) are only accessible within that block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  let blockVar = "Inside block";
  console.log(blockVar); // Accessible here
}

console.log(blockVar); // ❌ ReferenceError
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; var does not have block scope—only function scope.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  var x = 10;
}
console.log(x); // ✅ 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Functions in JavaScript</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Tue, 22 Jul 2025 09:57:00 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/functions-in-javascript-4e0h</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/functions-in-javascript-4e0h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Functions in JavaScript&lt;/strong&gt; are reusable blocks of code designed to perform specific tasks. They allow you to organize, reuse, and modularize code. It can take inputs, perform actions, and return outputs.&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(a, b) { 
    return a + b; 
}
console.log(sum(6, 9));     // output: 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Function Syntax and Working&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function definition is sometimes also termed a function declaration or function statement. Below are the rules for creating a function in JavaScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Begin with the keyword function Keyword&lt;/li&gt;
&lt;li&gt;A user-defined function name (In the above example, the name is sum)&lt;/li&gt;
&lt;li&gt;A list of parameters enclosed within parentheses and separated by commas (In the above example, parameters are x and y)&lt;/li&gt;
&lt;li&gt;A list of statements composing the body of the function enclosed within curly braces {} (In the above example, the statement is "return x + y").&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Return Statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function can return a result using the return keyword. This is optional but useful when you want to send data back from the function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Parameters are input passed to a function. In the above example, sum(x , y) takes two parameters, x and y.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calling Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After defining a function, the next step is to call them to make use of the function. We can call a function by using the function name separated by the value of parameters enclosed between the parenthesis.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Function Definition
function welcomeMsg(name) {
    return ("Hello " + name + " welcome");
}

let nameVal = "user";

// calling the function
console.log(welcomeMsg(nameVal));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello User welcome
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Function Expression&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is similar to a function declaration without the function name. Function expressions can be stored in a variable assignment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const mul = function (x, y) {
    return x * y;
};
console.log(mul(4, 5)); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arrow Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arrow functions are a concise syntax for writing functions, introduced in ES6, and they do not bind their own this context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sum = (num1,num2) =&amp;gt; {
return num1 + num2;
}
let result = sum(5,5)
console.log(result);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>JavaScript Loops</title>
      <dc:creator>Visali Nedunchezhian</dc:creator>
      <pubDate>Thu, 17 Jul 2025 18:00:53 +0000</pubDate>
      <link>https://dev.to/visali_nedunchezhian_ee73/javascript-loops-3dgi</link>
      <guid>https://dev.to/visali_nedunchezhian_ee73/javascript-loops-3dgi</guid>
      <description>&lt;p&gt;Loops in JavaScript are used to reduce repetitive tasks by repeatedly executing a block of code as long as a specified condition is true. This makes code more concise and efficient.&lt;/p&gt;

&lt;p&gt;Suppose we want to print 'Hello World' five times. Instead of manually writing the print statement repeatedly, we can use a loop to automate the task and execute it based on the given condition.&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%2Fr6odbgo9r55unjp651c7.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%2Fr6odbgo9r55unjp651c7.png" alt=" " width="428" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&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%2Fkoae4tybniotxzzgk1zx.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%2Fkoae4tybniotxzzgk1zx.png" alt=" " width="355" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. JavaScript for Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The for loop repeats a block of code a specific number of times. It contains initialization, condition, and increment/decrement in one line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&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%2F5u2hgqrywtipjajfrf21.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%2F5u2hgqrywtipjajfrf21.png" alt=" " width="677" height="118"&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%2F8i4nb05w5jdk7xwrrazp.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%2F8i4nb05w5jdk7xwrrazp.png" alt=" " width="681" height="283"&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%2Fkl4q72qfcldr6hzd2tca.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%2Fkl4q72qfcldr6hzd2tca.png" alt=" " width="440" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&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%2Fcbsfycdq704qv0iujzkm.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%2Fcbsfycdq704qv0iujzkm.png" alt=" " width="443" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this example&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initializes the counter variable (let i = 1).&lt;/li&gt;
&lt;li&gt;Tests the condition (i &amp;lt;= 3); runs while true.&lt;/li&gt;
&lt;li&gt;Executes the loop body and increments the counter (i++).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. JavaScript while Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The while loop executes as long as the condition is true. It can be thought of as a repeating if statement. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&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%2F7d4amie3b47tql0atok2.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%2F7d4amie3b47tql0atok2.png" alt=" " width="417" height="137"&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%2Fzfn1w4z32hcs8ruvw9m2.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%2Fzfn1w4z32hcs8ruvw9m2.png" alt=" " width="793" height="380"&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%2Fqsuxhx6ifk1vwi1yxvv6.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%2Fqsuxhx6ifk1vwi1yxvv6.png" alt=" " width="383" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&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%2F3m7bqr5pkv1577dky2gm.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%2F3m7bqr5pkv1577dky2gm.png" alt=" " width="410" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this example&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initializes the variable (let i = 0).&lt;/li&gt;
&lt;li&gt;Runs the loop body while the condition (i &amp;lt; 3) is true.&lt;/li&gt;
&lt;li&gt;Increments the counter after each iteration (i++).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. JavaScript do-while Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The do-while loop is similar to while loop except it executes the code block at least once before checking the condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&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%2Fj1z6kiq81q8l6ucy8227.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%2Fj1z6kiq81q8l6ucy8227.png" alt=" " width="418" height="132"&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%2Fegjv4eeqb1fdyvuq26xp.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%2Fegjv4eeqb1fdyvuq26xp.png" alt=" " width="670" height="378"&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%2Fk604te5emaqpj9aop1tt.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%2Fk604te5emaqpj9aop1tt.png" alt=" " width="427" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&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%2Fe8mz8sq7tptw7eyh9q2m.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%2Fe8mz8sq7tptw7eyh9q2m.png" alt=" " width="362" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Executes the code block first.&lt;/li&gt;
&lt;li&gt;Checks the condition (i &amp;lt; 3) after each iteration.&lt;/li&gt;
&lt;/ul&gt;

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