<?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: M Ramavel</title>
    <description>The latest articles on DEV Community by M Ramavel (@m_ramavel_8d478add09a105c).</description>
    <link>https://dev.to/m_ramavel_8d478add09a105c</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%2F3259181%2Fa549a035-819f-4c3a-aee7-a1226c1352d5.jpg</url>
      <title>DEV Community: M Ramavel</title>
      <link>https://dev.to/m_ramavel_8d478add09a105c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m_ramavel_8d478add09a105c"/>
    <language>en</language>
    <item>
      <title>Hooks</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Fri, 22 Aug 2025 09:30:23 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/hooks-121c</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/hooks-121c</guid>
      <description>&lt;h2&gt;
  
  
  UseState
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The useState hook is used to declare state variables in functional components. It allows us to read and update the state within the component.&lt;/li&gt;
&lt;/ul&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;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%2F3ggnpdiz11dpumasvcxk.gif" 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%2F3ggnpdiz11dpumasvcxk.gif" alt=" " width="311" height="155"&gt;&lt;/a&gt;&lt;/p&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;h2&gt;
  
  
  useEffect:
&lt;/h2&gt;

&lt;p&gt;The useEffect 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]);
useEffect(() =&amp;gt; { ... }, [dependencies]);
&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%2F75towca5h1sotn1f0fo9.gif" 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%2F75towca5h1sotn1f0fo9.gif" alt=" " width="893" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;runs side effects after rendering.&lt;br&gt;
The effect runs based on changes in the specified dependencies.&lt;/p&gt;
&lt;h2&gt;
  
  
  UseContext
&lt;/h2&gt;

&lt;p&gt;The useContext 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;/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%2Fch1undc57splnov7l0w9.gif" 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%2Fch1undc57splnov7l0w9.gif" alt=" " width="506" height="229"&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;const contextValue = useContext(MyContext);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  UseRef
&lt;/h2&gt;

&lt;p&gt;The useRef Hook allows you to persist values between renders.&lt;br&gt;
It can be used to store a mutable value that does not cause a re-render when updated.&lt;br&gt;
It can be used to access a DOM element directly.&lt;/p&gt;

&lt;p&gt;useRef() only returns one item. It returns an Object called current.&lt;/p&gt;

&lt;p&gt;When we initialize useRef we set the initial value: useRef(0)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Props</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Fri, 22 Aug 2025 09:15:15 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/props-m5g</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/props-m5g</guid>
      <description>&lt;p&gt;Props Stand's for Properties&lt;br&gt;
Props are used to pass data one Component to another&lt;br&gt;
Allow Data from parent to child component&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create the React App</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Fri, 08 Aug 2025 16:57:40 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/create-the-react-app-543</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/create-the-react-app-543</guid>
      <description>&lt;p&gt;A new React application can be created using the create-react-app tool, which is a command-line utility. This tool automates the setup of a new React project, including the necessary file structure, configuration files, and build scripts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To create a new React app, follow these steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install Node.js and npm (Node Package Manager): If not already installed, download and install Node.js from the official website, which includes npm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a terminal or command prompt.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute the &lt;code&gt;create-react-app&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;my-react-app&lt;/code&gt; with the desired name for the application. Navigate into the project directory.&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-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the development server.&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;&lt;strong&gt;Explaining Key Files&lt;/strong&gt;&lt;br&gt;
After creating a new React app, the project directory contains several important files and folders:&lt;br&gt;
&lt;strong&gt;public/index.html&lt;/strong&gt;:&lt;br&gt;
This is the main HTML file of the application. It serves as the single entry point for the React app, and the React components are rendered into a div element within this file (usually with the ID root).&lt;br&gt;
&lt;strong&gt;src/index.js&lt;/strong&gt;:&lt;br&gt;
This file is the JavaScript entry point for the React application. It imports the main App component and renders it into the root element defined in public/index.html.&lt;br&gt;
&lt;strong&gt;src/App.js:&lt;/strong&gt;&lt;br&gt;
This file defines the primary React component of the application, typically named App. This component serves as the root of the component tree and is where the main structure and content of the application are defined.&lt;br&gt;
&lt;strong&gt;src/App.css&lt;/strong&gt;:&lt;br&gt;
This file contains the CSS styles specifically for the App component.&lt;br&gt;
&lt;strong&gt;src/index.css&lt;/strong&gt;:&lt;br&gt;
This file contains global CSS styles applied to the entire application.&lt;br&gt;
&lt;strong&gt;package.json&lt;/strong&gt;:&lt;br&gt;
This file manages the project's metadata and dependencies. It lists the required packages and scripts for running, building, and testing the application.&lt;br&gt;
&lt;strong&gt;node_modules/:&lt;/strong&gt;&lt;br&gt;
This directory contains all the third-party libraries and packages required by the project, installed by npm.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Introduction..</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Thu, 07 Aug 2025 12:50:53 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/react-introduction-1d3</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/react-introduction-1d3</guid>
      <description>&lt;h2&gt;
  
  
  React
&lt;/h2&gt;

&lt;p&gt;React is a JavaScript library for building user interfaces.React is used to build single-page applications.React allows us to create reusable UI components.&lt;/p&gt;

&lt;h2&gt;
  
  
  Components
&lt;/h2&gt;

&lt;p&gt;React components are independent, reusable building blocks that define what gets displayed on the user interface in a React application. They serve a similar purpose to JavaScript functions but are specifically designed for rendering UI elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual DOM
&lt;/h2&gt;

&lt;p&gt;The React Virtual DOM (Document Object Model) is a lightweight, in-memory representation of the actual DOM. It is a key concept that enables React's efficient UI updates and performance. &lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Promise JS</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Mon, 04 Aug 2025 17:17:39 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/promise-js-4hjm</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/promise-js-4hjm</guid>
      <description>&lt;p&gt;A Promise in JavaScript is an object that represents the eventual completion (or failure) of an asynchronous operation and its resulting value.&lt;/p&gt;

&lt;p&gt;It helps you handle asynchronous operations like data fetching, file reading, or timers — without deeply nested callbacks (callback hell).&lt;/p&gt;

&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let promise = new Promise(function(resolve, reject) {
  if (/* success */) {
    resolve(result);  // Success
  } else {
    reject(error);    // Error
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Promise States&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Pending – Initial state, neither fulfilled nor rejected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fulfilled – Operation completed successfully.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rejected – Operation failed&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fwut1lkfwcaenidx7dqwc.jpeg" 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%2Fwut1lkfwcaenidx7dqwc.jpeg" alt=" " width="727" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Fetch API</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Mon, 04 Aug 2025 17:02:43 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/fetch-api-41fh</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/fetch-api-41fh</guid>
      <description>&lt;p&gt;The Fetch API provides a JavaScript interface for making HTTP requests and processing the responses&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the Fetch API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the Fetch API, you make a request by calling fetch(), which is available as a global function in both window and worker contexts. You pass it a Request object or a string containing the URL to fetch, along with an optional argument to configure the request.&lt;/p&gt;

&lt;p&gt;The fetch() function returns a Promise which is fulfilled with a Response object representing the server's response. You can then check the request status and extract the body of the response in various formats, including text and JSON, by calling the appropriate method on the response.&lt;/p&gt;

&lt;p&gt;Here's a minimal function that uses fetch() to retrieve some JSON data from a server:&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;fetch(url)
  .then
    (res=&amp;gt; res.json())
  .then(data =&amp;gt; {
    console.log(data);
  })
  .catch(error =&amp;gt; {
    console.error("Error:", error);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GET     -  Get data from server&lt;br&gt;
POST   -     Send data to server&lt;br&gt;
PUT      -  Update full resource&lt;br&gt;
DELETE  -   Delete a resource&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET Request to Retrieve Data&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fetch() sends the GET request to the specified URL.&lt;/li&gt;
&lt;li&gt;The response.json() method parses the JSON response.&lt;/li&gt;
&lt;li&gt;.then() logs the list of items once they are fetched
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.fetch('https://fakestoreapi.com/products/1')
    .then(response =&amp;gt; response.json())
    .then(items =&amp;gt; console.log(items))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;*&lt;em&gt;POST Request to Submit Data&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The method: 'POST' tells Fetch to send data to the server.&lt;/li&gt;
&lt;li&gt;The headers include the Content-Type to indicate we are sending JSON.&lt;/li&gt;
&lt;li&gt;The body contains the data to be sent, which is stringified using JSON.stringify().
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const data = { name: 'Pranjal', age: 25 };
fetch('https://fakestoreapi.com/products', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(data)
})
    .then(response =&amp;gt; response.json())
    .then(result =&amp;gt; console.log(result));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;*&lt;em&gt;PUT Request to Update Data&lt;br&gt;
*&lt;/em&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 updatedData = { id: 1, price: 300 };

fetch('https://fakestoreapi.com/products/1', {
    method: 'PUT',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(updatedData)
})
    .then(response =&amp;gt; response.json())
    .then(result =&amp;gt; console.log(result));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The method: 'PUT' indicates we are updating data.&lt;/li&gt;
&lt;li&gt;The body sends the updated data, converted to JSON.&lt;/li&gt;
&lt;li&gt;The response is parsed as JSON, and the updated result is logged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DELETE Request to Remove 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;fetch('https://fakestoreapi.com/products/1', {
    method: 'DELETE'
  })
    .then(response =&amp;gt; response.json())
    .then(result =&amp;gt; console.log('Deleted:', result));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;method: 'DELETE' indicates that we want to delete the specified resource.&lt;/li&gt;
&lt;li&gt;The response is parsed as JSON to confirm the deletion.&lt;/li&gt;
&lt;li&gt;The result is logged to indicate the operation was successful.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Types of Scope in JavaScript</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Wed, 16 Jul 2025 15:01:40 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/types-of-scope-in-javascript-5ca4</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/types-of-scope-in-javascript-5ca4</guid>
      <description>&lt;p&gt;✅ 1. Global Scope&lt;/p&gt;

&lt;p&gt;Declared outside of any function or block.&lt;/p&gt;

&lt;p&gt;Can be accessed 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 name = "Ram";  // Global scope

function greet() {
  console.log(name);  // ✅ Accessible
}

greet();

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

&lt;/div&gt;



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

&lt;p&gt;Variables declared with var, let, or const inside a function.&lt;/p&gt;

&lt;p&gt;Accessible only 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 test() {
  let x = 10;     // Function scope
  console.log(x); // ✅ Accessible
}

test();
// console.log(x); ❌ Not accessible outside


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

&lt;/div&gt;



&lt;p&gt;✅ 3. Block Scope (ES6)&lt;/p&gt;

&lt;p&gt;Variables declared with let or const inside {} (if, loop, etc.).&lt;/p&gt;

&lt;p&gt;Not accessible outside the 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 a = 5;
  const b = 10;
  console.log(a, b); // ✅ Accessible
}

// console.log(a, b); ❌ Not accessible outside the block

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>JavaScript Loop</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Mon, 14 Jul 2025 15:37:30 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/javascript-loop-1kh4</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/javascript-loop-1kh4</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;h2&gt;
  
  
  For loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (initialization; condition; increment/decrement)
{
    // Code to execute
}
&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%2F1dwewtetguzuq3plgavw.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%2F1dwewtetguzuq3plgavw.png" alt=" " width="548" height="225"&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;for (let i = 0; i &amp;lt; 5; i++) {
    console.log(i);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  while-loop
&lt;/h2&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;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%2Ftxbz1dzcdnbkqw0gzwte.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%2Ftxbz1dzcdnbkqw0gzwte.png" alt=" " width="800" height="370"&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;let i = 0;
while (i &amp;lt; 5) {
    console.log(i);
    i++;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Do While loop
&lt;/h2&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;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%2Fjw5fg02kahb6k1954yzu.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%2Fjw5fg02kahb6k1954yzu.png" alt=" " width="539" height="301"&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;let i = 0;
do {
    console.log("Iteration:", i);
    i++;
} while (i &amp;lt; 3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;do {&lt;br&gt;
    // Code to execute&lt;br&gt;
} while (condition);&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Conditional Statements</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Fri, 11 Jul 2025 15:43:29 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/conditional-statements-phg</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/conditional-statements-phg</guid>
      <description>&lt;p&gt;conditional statements are used to perform different actions based on different conditions. Here's a breakdown of the most common types conditional statements&lt;/p&gt;

&lt;h2&gt;
  
  
  🟩 1. if Statement
&lt;/h2&gt;

&lt;p&gt;Executes a block of code if a specified condition is true.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 18;
if (age &amp;gt;= 18) {
  console.log("You are an adult.");
}//You are an adult
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🟨 2. if...else Statement
&lt;/h2&gt;

&lt;p&gt;Executes one block of code if the condition is true, and another if it's false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 16;
if (age &amp;gt;= 18) {
  console.log("You are an adult.");
} else {
  console.log("You are a minor.");
}//You are a minor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🟦 3. if...else if...else Statement
&lt;/h2&gt;

&lt;p&gt;Checks multiple conditions in sequence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let score = 75;
if (score &amp;gt;= 90) {
  console.log("Grade: A");
} else if (score &amp;gt;= 70) {
  console.log("Grade: B");
} else {
  console.log("Grade: C or below");
}//Grade B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Switch Statement
&lt;/h2&gt;

&lt;p&gt;The switch statement is used to perform different actions based on different conditions&lt;br&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;switch(expression) {
  case x:
    // code block
    break;
  case y:
    // code block
    break;
  default:
    // code block
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let day;
switch (new Date().getDay()) {
  case 0:
    day = "Sunday";
    break;
  case 1:
    day = "Monday";
    break;
  case 2:
     day = "Tuesday";
    break;
  case 3:
    day = "Wednesday";
    break;
  case 4:
    day = "Thursday";
    break;
  case 5:
    day = "Friday";
    break;
  case 6:
    day = "Saturday";
}


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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Operators</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Thu, 10 Jul 2025 08:59:40 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/operators-3len</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/operators-3len</guid>
      <description>&lt;h2&gt;
  
  
  Arithmetic Operators
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A typical arithmetic operation operates on two numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding&lt;/strong&gt;&lt;br&gt;
The addition operator (+) adds numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 2;
let z = x + y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;\Output 7&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subtracting&lt;/strong&gt;&lt;br&gt;
The subtraction operator (-) subtracts numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 2;
let z = x - y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;\Output 3&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiplying&lt;/strong&gt;&lt;br&gt;
The multiplication operator (*) multiplies numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 2;
let z = x * y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;\Output 10&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dividing&lt;/strong&gt;&lt;br&gt;
The division operator (/) divides numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 2;
Console.lof("x / y");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;\Output 2&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remainder&lt;/strong&gt;&lt;br&gt;
The modulus operator (%) returns the division remainder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 2;
Let z =x%y;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;\Output 1&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incrementing&lt;/strong&gt;&lt;br&gt;
The increment operator (++) increments numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
x++;
let z = x;

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

&lt;/div&gt;



&lt;p&gt;\Output 6&lt;br&gt;
&lt;strong&gt;Decrementing&lt;/strong&gt;&lt;br&gt;
The decrement operator (--) decrements numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
x--;
let z = x;

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

&lt;/div&gt;



&lt;p&gt;\Output 4&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Variable's</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Wed, 09 Jul 2025 12:48:02 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/javascript-variables-14jd</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/javascript-variables-14jd</guid>
      <description>&lt;h2&gt;
  
  
  Variable
&lt;/h2&gt;

&lt;p&gt;In JavaScript, a variable is a named container used to store data values&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using var&lt;/li&gt;
&lt;li&gt;Using let&lt;/li&gt;
&lt;li&gt;Using const&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Var:&lt;/strong&gt;&lt;br&gt;
The var keyword is used to declare a variable. It was the original way to declare variables in JavaScript and has specific characteristics&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;
var y= 20;
console.log(x); 
// Output: 10

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Let&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The let keyword was introduced in ES6 (2015)&lt;/li&gt;
&lt;li&gt;Variables declared with let have Block Scope&lt;/li&gt;
&lt;li&gt;Variables declared with let must be Declared before use&lt;/li&gt;
&lt;li&gt;Variables declared with let cannot be Redeclared in the same scope
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  let x = 2;
Console.log(x)
}
// x can NOT be used here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Const&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The const keyword was introduced in ES6 (2015)&lt;/li&gt;
&lt;li&gt;Variables defined with const cannot be Redeclared&lt;/li&gt;
&lt;li&gt;Variables defined with const cannot be Reassigned&lt;/li&gt;
&lt;li&gt;Variables defined with const have Block Scope
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    const x = 10;
    console.log(x); 
// Output: 10
}
console.log(x);
 // ReferenceError: x is not defined

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>What is The Viewport?🤔</title>
      <dc:creator>M Ramavel</dc:creator>
      <pubDate>Thu, 03 Jul 2025 12:39:46 +0000</pubDate>
      <link>https://dev.to/m_ramavel_8d478add09a105c/what-is-the-viewport-5e8a</link>
      <guid>https://dev.to/m_ramavel_8d478add09a105c/what-is-the-viewport-5e8a</guid>
      <description>&lt;ul&gt;
&lt;li&gt;The viewport is the user's visible area of a web page.👩‍💻&lt;/li&gt;
&lt;li&gt;The viewport varies with the device, and will be smaller on a mobile phone than on a computer screen.&lt;/li&gt;
&lt;li&gt;Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Viewport&lt;/strong&gt;&lt;br&gt;
HTML5 introduced a method to let web designers take control over the viewport, through the &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;You should include the following &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; viewport element in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section of all your web pages:&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;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).📱&lt;/li&gt;
&lt;li&gt;The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser&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%2Flhm5mbqd2x0dpdzrp3t8.jpg" 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%2Flhm5mbqd2x0dpdzrp3t8.jpg" alt="Image description" width="604" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

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