<?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: Ranjani R</title>
    <description>The latest articles on DEV Community by Ranjani R (@asran_2025).</description>
    <link>https://dev.to/asran_2025</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%2F3253627%2F26df7854-b18b-422f-900a-daa56c8fc201.png</url>
      <title>DEV Community: Ranjani R</title>
      <link>https://dev.to/asran_2025</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asran_2025"/>
    <language>en</language>
    <item>
      <title>A DAY IN MY LIFE</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Sun, 24 Aug 2025 06:46:27 +0000</pubDate>
      <link>https://dev.to/asran_2025/a-day-in-my-life-4j5c</link>
      <guid>https://dev.to/asran_2025/a-day-in-my-life-4j5c</guid>
      <description>&lt;p&gt;My day typically goes on like this:&lt;/p&gt;

&lt;p&gt;I wake up in the morning and get ready for the REACT class which starts at 6:00 am and ends at 7:30 am. After that I wake up the kids and get them ready for school...preparing breakfast snacks bathing them etc and drop them at school by 9:30 am. Then I come home and have my breakfast and do some household stuff. At around 10:30 am or 11:00 am (depending on the work) I start practicing JS or write blog till around 12:00 pm post which I get up to prepare lunch for my elder kid and then leave the lunch at school and bring home my younger kid.&lt;br&gt;
             Then it is lunch time so after all that is over around 2:00pm I again sit down for some coding practice. At 3:00 pm I go to pick up my elder kid and after that I will have around 1 more hour time for coding till my younger kid wakes up post which I become busy with household work and helping the elder kid with schoolwork. Then it becomes dinnertime and then at around 10:00 pm the kids go to sleep post which I become tired to do anymore coding work and also go to sleep.&lt;br&gt;
     This is my schedule for weekdays....on weekends I get some more time in the evening for practice and some time in the night (around 4 hours in total) since it is a holiday.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>REACT-useContext Hook</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Fri, 22 Aug 2025 09:07:48 +0000</pubDate>
      <link>https://dev.to/asran_2025/react-usecontext-hook-4ho8</link>
      <guid>https://dev.to/asran_2025/react-usecontext-hook-4ho8</guid>
      <description>&lt;p&gt;Today I will explain about the &lt;strong&gt;useContext&lt;/strong&gt; hook in react which helps avoid &lt;strong&gt;prop drilling(reusing of state variables in deeply nested components)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;useContext is a React Hook that allows us to access values from a React Context directly inside your functional components. It’s part of React’s strategy to simplify state sharing across deeply nested components.&lt;/p&gt;

&lt;p&gt;The main uses of this are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoids Prop Drilling:&lt;/strong&gt; No need to pass props through multiple layers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Centralized State:&lt;/strong&gt; Ideal for global data like themes, user authentication, or language settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cleaner Code:&lt;/strong&gt; Makes our component tree easier to manage and read.&lt;/p&gt;

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

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

const ThemeContext = createContext('light'); // 'light' is the default value

Wrap our app component in provider and give value

&amp;lt;ThemeContext.Provider value="dark"&amp;gt;
  &amp;lt;App /&amp;gt;
&amp;lt;/ThemeContext.Provider&amp;gt;

import { useContext } from 'react';

function Button() {
  const theme = useContext(ThemeContext);
  return &amp;lt;button className={theme}&amp;gt;Click me&amp;lt;/button&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the value passed to the Provider changes, all components using useContext will re-render automatically with the new value.&lt;/p&gt;

&lt;p&gt;This is the way useContext works and this is very useful in the real world applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>REACT-HOOKS</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Mon, 18 Aug 2025 05:29:33 +0000</pubDate>
      <link>https://dev.to/asran_2025/react-hooks-2430</link>
      <guid>https://dev.to/asran_2025/react-hooks-2430</guid>
      <description>&lt;p&gt;Let's see about &lt;strong&gt;hooks&lt;/strong&gt; in REACT today. Hooks are &lt;em&gt;powerful tools&lt;/em&gt; in react for functional components that allows us to access the state,side effects,contexts,refs etc. They are basically special functions that allows us to hook into the functional components. The basic hooks are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.useState:&lt;/strong&gt; useState lets us add reactive state to functional components. When the state changes, React re-renders the component with the new value. The syntax is:&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;state: current value&lt;/li&gt;
&lt;li&gt;setState: function to update the value&lt;/li&gt;
&lt;li&gt;initialValue: starting value (number, string, object, array, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is mainly used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track selected filters, input values, toggle states&lt;/li&gt;
&lt;li&gt;Dynamically update UI based on user interaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.useEffect:&lt;/strong&gt; useEffect lets us run side effects after a component renders—like fetching data, setting up timers, or listening to events.The syntax is:&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
  return () =&amp;gt; {
    // cleanup logic (optional)
  };
}, [dependencies]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It runs after render&lt;br&gt;
Re-runs when dependencies change&lt;br&gt;
Cleanup runs before next effect or on unmount&lt;/p&gt;

&lt;p&gt;It is useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch and render product data dynamically&lt;/li&gt;
&lt;li&gt;Sync UI with external sources&lt;/li&gt;
&lt;li&gt;Clean up timers, listeners, or subscriptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.useRef:&lt;/strong&gt; useRef creates a mutable reference that persists across renders without causing re-renders. It’s great for accessing DOM elements or storing values that don’t need to trigger UI updates. The syntax is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const ref = useRef(initialValue);&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ref.current holds the value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;const inputRef = useRef();&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
  inputRef.current.focus();&lt;br&gt;
}, []);&lt;/p&gt;

&lt;p&gt;return ;&lt;/p&gt;

&lt;p&gt;It's useful for&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access DOM elements directly (e.g., scroll, focus)&lt;/li&gt;
&lt;li&gt;Store timers, previous values, or flags&lt;/li&gt;
&lt;li&gt;Avoid unnecessary re-renders when tracking values&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>career</category>
    </item>
    <item>
      <title>REACT- FUNCTIONAL COMPONENT</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Tue, 12 Aug 2025 13:57:27 +0000</pubDate>
      <link>https://dev.to/asran_2025/react-functional-component-fcg</link>
      <guid>https://dev.to/asran_2025/react-functional-component-fcg</guid>
      <description>&lt;p&gt;Today I am going to explain about &lt;strong&gt;Functional Components&lt;/strong&gt; in REACT which is kind of the basic building block of a React App.&lt;/p&gt;

&lt;p&gt;A functional component is simply a JavaScript Function that returns a JSX( React extension for JS describing UI). It's the modern and most preferred way for writing components since it uses &lt;strong&gt;Hooks&lt;/strong&gt; which allows these components to manage states, changes, side effects etc.&lt;/p&gt;

&lt;p&gt;The key characteristics of these are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stateless or Stateful: Originally used for stateless components, but now can manage state using Hooks.&lt;/li&gt;
&lt;li&gt;Simpler Syntax: No need for class, this, or lifecycle methods.&lt;/li&gt;
&lt;li&gt;Reusable: Can be composed and reused.&lt;/li&gt;
&lt;li&gt;Pure Functions: Ideally, they behave like pure functions—given the same props, they return the same output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The basic syntax is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Greeting(props) {
  return &amp;lt;h1&amp;gt;Hello, {props.name}!&amp;lt;/h1&amp;gt;;
}

//Arrow Function

const Greeting = ({ name }) =&amp;gt; &amp;lt;h1&amp;gt;Hello, {name}!&amp;lt;/h1&amp;gt;;

//We can call the component like below:

&amp;lt;Greeting name="Ranjani" /&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;The main benefits of using these components are:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Simpler Syntax&lt;/em&gt; : Easier to read, write and maintain.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hooks Support&lt;/em&gt; : Full access to state, effects, context, etc.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Performance&lt;/em&gt;: Faster due to less overhead(memory usage, complexity, execution time).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Encourages Best Practices&lt;/em&gt;: Promotes pure functions and separation of concerns.&lt;/p&gt;

&lt;p&gt;So we can use functional components when we need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UI elements&lt;/li&gt;
&lt;li&gt;Reusable widgets&lt;/li&gt;
&lt;li&gt;Pages and layouts&lt;/li&gt;
&lt;li&gt;Dynamic components with state and effect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's all regarding functional components. See you all in the next post!&lt;/p&gt;

</description>
      <category>react</category>
      <category>java</category>
    </item>
    <item>
      <title>INSTALLING NODE.JS</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Fri, 08 Aug 2025 05:57:06 +0000</pubDate>
      <link>https://dev.to/asran_2025/installing-nodejs-4ba0</link>
      <guid>https://dev.to/asran_2025/installing-nodejs-4ba0</guid>
      <description>&lt;p&gt;Today i am going to tell the steps involved in installing &lt;strong&gt;Node.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Node.js is a free, open-source, cross-platform JavaScript runtime environment that lets you run JavaScript outside the browser—primarily on servers&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here are the steps involved in downloading and installing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the official Node.js download page - &lt;em&gt;&lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;https://nodejs.org/en/download&lt;/a&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Choose the LTS version (Long-Term Support) for stability.&lt;/li&gt;
&lt;li&gt;Download the .msi installer for Windows (32-bit or 64-bit depending on our system).&lt;/li&gt;
&lt;li&gt;Double-click the downloaded .msi file.

&lt;ul&gt;
&lt;li&gt;Follow the setup wizard:&lt;/li&gt;
&lt;li&gt;Accept the license agreement.&lt;/li&gt;
&lt;li&gt;Use the default installation settings.&lt;/li&gt;
&lt;li&gt;Ensure npm (Node Package Manager) is selected for installation.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Click Install and wait for the process to finish.&lt;/li&gt;

&lt;li&gt;Click Finish when done.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Now in order to check if it has been installed correctly, open command prompt/powershell and type in the following command and press enter:&lt;br&gt;
         &lt;code&gt;node -v&lt;/code&gt;&lt;br&gt;
         &lt;code&gt;npm -v&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It should display the version of node.js and npm installed. Once installed we need to create our very own REACT app.&lt;/p&gt;

&lt;p&gt;1.Open &lt;strong&gt;Visual Studio&lt;/strong&gt; and create a local folder with any name of your choice. Once created ,right click on the folder name and select &lt;strong&gt;Open in Integrated Terminal&lt;/strong&gt; which will then open the terminal in your VS code and the path to your folder will be displayed.&lt;/p&gt;

&lt;p&gt;2.Type in the command &lt;strong&gt;npx create-react-app folder name&lt;/strong&gt; and press &lt;strong&gt;Enter&lt;/strong&gt;. Note that the folder name should be only in &lt;strong&gt;small letters&lt;/strong&gt; and no space. Once you press enter the you will be asked a question:&lt;br&gt;
_&lt;br&gt;
Need to install the following packages:&lt;br&gt;
&lt;a href="mailto:create-react-app@5.1.0"&gt;create-react-app@5.1.0&lt;/a&gt;&lt;br&gt;
Ok to proceed? (y) y_&lt;/p&gt;

&lt;p&gt;Enter y and a new React app will start creating.....it might take sometime depending upon the network speed and RAM memory (typically 5-8mins).&lt;/p&gt;

&lt;p&gt;3.Once the app is created we need to start the server. To do this type in &lt;strong&gt;npm start&lt;/strong&gt; to start the server.&lt;/p&gt;

&lt;p&gt;3.Once the app is created it will be visible under your folder structure. It will contain many folders and I will explain what each folder means and contains. The following will be the folder structure once the app is successfully created:&lt;/p&gt;

&lt;p&gt;my-app/&lt;br&gt;
├── node_modules/&lt;br&gt;
├── public/&lt;br&gt;
│   ├── index.html&lt;br&gt;
│   └── ...&lt;br&gt;
├── src/&lt;br&gt;
│   ├── App.js&lt;br&gt;
│   ├── App.css&lt;br&gt;
│   ├── index.js&lt;br&gt;
│   ├── index.css&lt;br&gt;
│   └── ...&lt;br&gt;
├── .gitignore&lt;br&gt;
├── package.json&lt;br&gt;
├── README.md&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;node_modules:

&lt;ul&gt;
&lt;li&gt;Contains all installed dependencies from npm.&lt;/li&gt;
&lt;li&gt;We don’t edit this manually.&lt;/li&gt;
&lt;li&gt;Automatically generated when we run npm install.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.public:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Holds static files that don’t go through Webpack.&lt;/li&gt;
&lt;li&gt;Key files:&lt;/li&gt;
&lt;li&gt;index.html: The single HTML file React injects into.&lt;/li&gt;
&lt;li&gt;favicon.ico, manifest.json: Icons and metadata for our page.&lt;/li&gt;
&lt;li&gt;We can add images, fonts, or other assets here if we want them served directly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.src:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The heart of our React app—where all our code lives.&lt;/li&gt;
&lt;li&gt;Key files:&lt;/li&gt;
&lt;li&gt;index.js: Entry point. Renders  into index.html.&lt;/li&gt;
&lt;li&gt;App.js: Root component. You build our UI from here.&lt;/li&gt;
&lt;li&gt;App.css, index.css: Styles for our components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.gitignore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tells Git which files/folders to ignore (e.g., node_modules).&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;package.json:

&lt;ul&gt;
&lt;li&gt;Lists dependencies, scripts, and metadata.&lt;/li&gt;
&lt;li&gt;We can run commands like npm start, npm build from here.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;6.README.md:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Documentation for our project. Helpful for collaborators or future us!.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the steps involved in installing and creating React app.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>INTRODUCTION TO REACT</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Thu, 07 Aug 2025 05:53:04 +0000</pubDate>
      <link>https://dev.to/asran_2025/introduction-to-react-8j4</link>
      <guid>https://dev.to/asran_2025/introduction-to-react-8j4</guid>
      <description>&lt;p&gt;Hi all today I will be giving a small intro about &lt;strong&gt;REACT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;REACT&lt;/strong&gt; or React.js is an open-source Javascript library developed by &lt;strong&gt;Facebook&lt;/strong&gt;. The term open-source means that it is available for free of cost and also that anyone can contribute to making any updates or changes in the library.&lt;/p&gt;

&lt;p&gt;React is primarily used for building &lt;strong&gt;dynamic , interactive UI's&lt;/strong&gt; especially for &lt;strong&gt;single-page&lt;/strong&gt; applications.&lt;/p&gt;

&lt;p&gt;React focuses on &lt;em&gt;performance&lt;/em&gt;, &lt;em&gt;scalability&lt;/em&gt;, and &lt;em&gt;simplicity&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The core concepts of React are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Component-Based Architecture&lt;/strong&gt;: UI is broken into reusable components (like functions).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSX&lt;/strong&gt;: (JavaScript XML) A syntax extension that lets you write HTML-like code inside JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Props&lt;/strong&gt;: Inputs passed to components to customize behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State&lt;/strong&gt;: Internal data that controls component behavior and rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hooks&lt;/strong&gt;: Functions like &lt;em&gt;useState&lt;/em&gt; and &lt;em&gt;useEffect&lt;/em&gt; that manage state and lifecycle in functional components.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React works by creating a &lt;strong&gt;virtual DOM&lt;/strong&gt; which is a &lt;strong&gt;light-weight&lt;/strong&gt; copy of the real DOM. It first updates any changes made to the page in the virtual DOM and after comparison with the original DOM it makes only the necessary changes to the original DOM. In this way the rendering becomes more &lt;strong&gt;fast&lt;/strong&gt; and &lt;strong&gt;efficient&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;React also provides components that can be reused in order to improve the functionality of JS and also makes the code clean and easier to maintain.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JS-LOCAL STORAGE</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Wed, 06 Aug 2025 06:13:21 +0000</pubDate>
      <link>https://dev.to/asran_2025/js-local-storage-4o7g</link>
      <guid>https://dev.to/asran_2025/js-local-storage-4o7g</guid>
      <description>&lt;p&gt;Today I am going to explain about &lt;strong&gt;Local Storage&lt;/strong&gt; which is a powerful feature in web development which allows us to store &lt;strong&gt;user preferences&lt;/strong&gt; &lt;strong&gt;UI states&lt;/strong&gt; or temporary data without requiring a server.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Local Storage is part of the Web Storage API, which provides a way to store key-value pairs in a web browser. Unlike cookies, it doesn’t get sent to the server with every request, and it offers more space (usually around 5MB per origin). *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The key characteristics of this are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Persistent: Data stays even after the browser is closed.&lt;/li&gt;
&lt;li&gt;Synchronous: Operations block the main thread &lt;/li&gt;
&lt;li&gt;String-based: Only strings can be stored — we’ll need JSON.stringify() and JSON.parse() for objects or arrays.&lt;/li&gt;
&lt;li&gt;Same-origin: Data is accessible only to pages from the same domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the common Local Storage methods:&lt;br&gt;
&lt;/p&gt;

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

// Retrieve data
const name = localStorage.getItem('username'); // "Ranjani"

// Remove specific item
localStorage.removeItem('username');

// Clear all local storage
localStorage.clear();

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

&lt;/div&gt;



&lt;p&gt;One main thing to remember is we should not use this to store sensitive data like passwords and tokens. The main reason for this is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Any script running on the browser can have access to the data in Local Storage and hence there is risk of malicious scripts hacking the tokens.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.Sensitive data is stored as plain text and not encrypted.&lt;/p&gt;

&lt;p&gt;3.There is no expiry date for Local Storage unlike cookies and so these data might remain even after user logs out.&lt;/p&gt;

&lt;p&gt;4.Tools like browser dev tools or extensions can read it without restriction.&lt;/p&gt;

&lt;p&gt;Hence we can use this storage to save temporary user states, form inputs etc.&lt;/p&gt;

&lt;p&gt;That's all about Local Storage....see you all in the next post.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>JS-FETCH API</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Mon, 04 Aug 2025 10:11:30 +0000</pubDate>
      <link>https://dev.to/asran_2025/js-fetch-api-19h1</link>
      <guid>https://dev.to/asran_2025/js-fetch-api-19h1</guid>
      <description>&lt;p&gt;Today I am going to discuss about the &lt;strong&gt;Fetch API&lt;/strong&gt; which is the most powerful and modern way to handle HTML requests.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Fetch API is a built-in JavaScript interface that allows you to make network requests similar to &lt;strong&gt;XMLHttpRequest&lt;/strong&gt;, but with a cleaner, promise-based syntax. It’s widely used for fetching resources like JSON data from APIs, submitting form data, or uploading files.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is mainly used because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Replaces the more complex XML requests.&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;Promises&lt;/strong&gt; to make async operations which is more effective.
3.Works in both browser and worker contexts.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax:

fetch(url, options)
  .then(response =&amp;gt; response.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;The most common HTTP methods are&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET&lt;/strong&gt;  Retrieve data&lt;br&gt;
&lt;strong&gt;POST&lt;/strong&gt; Add new data to server&lt;br&gt;
&lt;strong&gt;PUT&lt;/strong&gt;  Update existing data&lt;br&gt;
&lt;strong&gt;DELETE&lt;/strong&gt; Remove existing data from server&lt;/p&gt;

&lt;p&gt;Fetch supports Cross-Origin Resource Sharing (CORS), allowing requests to external domains if the server permits it.&lt;/p&gt;

&lt;p&gt;That's all about the Fetch API....see you all in the next post.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JS-CALLBACK FUNCTIONS</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Sat, 02 Aug 2025 12:38:18 +0000</pubDate>
      <link>https://dev.to/asran_2025/js-callback-functions-23d5</link>
      <guid>https://dev.to/asran_2025/js-callback-functions-23d5</guid>
      <description>&lt;p&gt;Hello all...today I will be telling about &lt;strong&gt;callback&lt;/strong&gt; functions in &lt;strong&gt;Javascript&lt;/strong&gt;. A callback function is a function which is passed as an argument to another function and is executed once the parent function completes its execution. This is especially useful for asynchronous operations like &lt;strong&gt;API calls , timers  or event handling&lt;/strong&gt;. The reason why we use callback functions is because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They allow asynchronous behaviour in a &lt;strong&gt;single-threaded&lt;/strong&gt; language (meaning the code is executed line by line and only after the current line is executed ,the next line starts executing).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.They're essential for tasks like loading data, handling user input, or animations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example:
function greetUser(name, callback) {
  console.log("Hello, " + name + "!");
  callback(); // Call the function passed in
}

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

greetUser("Ranjani", sayGoodbye);

//Output
Hello, Ranjani!
Goodbye!

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

&lt;/div&gt;



&lt;p&gt;Next let's talk about &lt;strong&gt;Callback Hell&lt;/strong&gt; also known as Pyramid of Doom. Callback hell happens when callbacks are nested within callbacks, creating deeply indented, hard-to-read code. This often occurs when multiple asynchronous tasks depend on each other. The problems with callback hell are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Poor readability and maintainability&lt;/li&gt;
&lt;li&gt;Difficult to Debug&lt;/li&gt;
&lt;li&gt;Inversion of control (we lose control over the flow of the program).
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example:

function task1(callback) {
  setTimeout(() =&amp;gt; {
    console.log("Task 1 completed");
    callback();
  }, 1000);
}

function task2(callback) {
  setTimeout(() =&amp;gt; {
    console.log("Task 2 completed");
    callback();
  }, 1000);
}

function task3(callback) {
  setTimeout(() =&amp;gt; {
    console.log("Task 3 completed");
    callback();
  }, 1000);
}

// Nested callbacks — the pyramid begins
task1(() =&amp;gt; {
  task2(() =&amp;gt; {
    task3(() =&amp;gt; {
      console.log("All tasks completed");
    });
  });
});

Output:
Task 1 completed
Task 2 completed
Task 3 completed
All tasks completed

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

&lt;/div&gt;



&lt;p&gt;In the above code, it becomes really hard to follow due to deep nesting of elements, errors are hard to find and correct and also adding or modifying logic becomes very difficult. Hence in order to avoid this type of scenarios we go for a modern solution known as &lt;strong&gt;Promises.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Promise&lt;/strong&gt; is an object that represents the eventual completion (or failure) of an asynchronous operation. It helps flatten nested callbacks and makes code more readable. It has the following states and methods:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Pending&lt;/em&gt;: Initial state&lt;br&gt;
&lt;em&gt;- Fulfilled&lt;/em&gt;: Operation completed successfully&lt;br&gt;
&lt;em&gt;- Rejected&lt;/em&gt;: Operation failed&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- .then()&lt;/em&gt; — handles success&lt;br&gt;
&lt;em&gt;- .catch()&lt;/em&gt; — handles errors&lt;br&gt;
&lt;em&gt;- .finally()&lt;/em&gt; — runs regardless of outcome&lt;/p&gt;

&lt;p&gt;So that's it about callbacks, callback hell and promises. Will talk in more detail about promises in the next post.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JAVASCRIPT-LOCAL STORAGE</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Thu, 24 Jul 2025 10:28:05 +0000</pubDate>
      <link>https://dev.to/asran_2025/javascript-local-storage-5blg</link>
      <guid>https://dev.to/asran_2025/javascript-local-storage-5blg</guid>
      <description>&lt;p&gt;Today I will explain about localStorage in JS which is used to store data from our web page in the user's browsers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;LocalStorage&lt;/strong&gt; is a powerful feature in web development that lets us store data persistently in the user's browser. It's especially useful for frontend projects where we want to remember &lt;strong&gt;user preferences&lt;/strong&gt;, save &lt;strong&gt;form inputs&lt;/strong&gt;, or &lt;strong&gt;cache data&lt;/strong&gt; without needing a backend.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In order to use LocalStorage we can follow the below steps:&lt;br&gt;
&lt;/p&gt;

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

// Retrieve data
const name = localStorage.getItem('username'); // "Ranjani"

//Remove a specific item
localStorage.removeItem('username');

// Clear all data
localStorage.clear();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can use Local Storage in the following situations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saving theme preferences (light/dark mode)&lt;/li&gt;
&lt;li&gt;Storing form data temporarily&lt;/li&gt;
&lt;li&gt;Caching API responses for faster reloads&lt;/li&gt;
&lt;li&gt;Keeping user settings across sessions&lt;/li&gt;
&lt;li&gt;Building offline-friendly experiences&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's all for today...see you all in the next post!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>JavaScript-DOM Events</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Wed, 23 Jul 2025 10:15:57 +0000</pubDate>
      <link>https://dev.to/asran_2025/javascript-dom-events-45cb</link>
      <guid>https://dev.to/asran_2025/javascript-dom-events-45cb</guid>
      <description>&lt;p&gt;Today I am going to talk about the common events that occur in a DOM. First of all what is an event?&lt;/p&gt;

&lt;p&gt;_DOM events are signals that something has happened in the browser—like a user clicking a button, typing in a field, or scrolling the page. JavaScript can listen for these events and respond with custom behaviour.&lt;br&gt;
_&lt;/p&gt;

&lt;p&gt;These are the key aspects of a DOM event&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Event:&lt;/strong&gt; A specific action (e.g. click, scroll, keydown, mouseover)&lt;br&gt;
&lt;strong&gt;- Event Listener:&lt;/strong&gt; A function that waits for an event and runs code when it happens&lt;br&gt;
&lt;strong&gt;- Event Target:&lt;/strong&gt; The element that triggered the event&lt;br&gt;
&lt;strong&gt;- Event Object:&lt;/strong&gt;Contains details about the event (e.g. mouse position, key pressed)&lt;/p&gt;

&lt;p&gt;Some Form related events are :&lt;br&gt;
&lt;strong&gt;submit:&lt;/strong&gt; Form is submitted&lt;br&gt;
&lt;strong&gt;change:&lt;/strong&gt; Input value changes(after blur)&lt;br&gt;
&lt;strong&gt;input:&lt;/strong&gt;Input value changes (live)&lt;br&gt;
&lt;strong&gt;focus:&lt;/strong&gt;Element gains focus&lt;br&gt;
&lt;strong&gt;blur:&lt;/strong&gt; Elements loses focus&lt;br&gt;
&lt;strong&gt;reset:&lt;/strong&gt;Form is reset&lt;/p&gt;

&lt;p&gt;So these are the commonly occuring DOM events and we can use these to make our webpage more enhancing and interactive.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript DOM</title>
      <dc:creator>Ranjani R</dc:creator>
      <pubDate>Tue, 22 Jul 2025 05:28:30 +0000</pubDate>
      <link>https://dev.to/asran_2025/javascript-dom-455f</link>
      <guid>https://dev.to/asran_2025/javascript-dom-455f</guid>
      <description>&lt;p&gt;Hi all good morning. Today I am going to give a short explanation on the &lt;strong&gt;DOM&lt;/strong&gt; element in HTML which helps &lt;strong&gt;JavaScript&lt;/strong&gt; to access the elements of HTML page and modify,delete,etc dynamically.&lt;br&gt;
 First of all what is a DOM🤔? The answer to that is here:&lt;br&gt;
 The DOM is a W3C (World Wide Web Consortium) standard.&lt;/p&gt;

&lt;p&gt;The DOM defines a standard for accessing documents:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The above is the official definition of a DOM. In other words a HTML DOM is a standard for how to &lt;strong&gt;change&lt;/strong&gt; , &lt;strong&gt;access&lt;/strong&gt; , &lt;strong&gt;add&lt;/strong&gt; or &lt;strong&gt;delete&lt;/strong&gt; HTML elements.&lt;/p&gt;

&lt;p&gt;With the object model, JavaScript gets all the power it needs to create dynamic HTML:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript can change all the HTML elements in the page.&lt;/li&gt;
&lt;li&gt;JavaScript can change all the HTML attributes in the page.&lt;/li&gt;
&lt;li&gt;JavaScript can change all the CSS styles in the page.&lt;/li&gt;
&lt;li&gt;JavaScript can remove existing HTML elements and attributes.&lt;/li&gt;
&lt;li&gt;JavaScript can add new HTML elements and attributes.&lt;/li&gt;
&lt;li&gt;JavaScript can react to all existing HTML events in the page.&lt;/li&gt;
&lt;li&gt;JavaScript can create new HTML events in the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the DOM tree the entire content present in the HTML page is broken up into nodes and each node represents a particular element of the page.&lt;/p&gt;

&lt;p&gt;We can perform the above actions using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
- Select elements: document.querySelector('h1')
- Change content: element.textContent = "Hello!"
- Modify styles: element.style.color = "blue"
- Handle events: element.addEventListener('click', ...)
- Create/remove elements: document.createElement('div'), element.remove()

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

&lt;/div&gt;



&lt;p&gt;Apart from the above uses, the DOM is a very important part of web development because it helps major frameworks like &lt;strong&gt;React&lt;/strong&gt; , &lt;strong&gt;Vue&lt;/strong&gt; and &lt;strong&gt;Angular&lt;/strong&gt; to handle elements in real time.&lt;/p&gt;

&lt;p&gt;So that's all about DOM.....hope this post has been useful. See you all in the next post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;em&gt;w3schools.com&lt;/em&gt;&lt;/p&gt;

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