<?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: Vasanth S</title>
    <description>The latest articles on DEV Community by Vasanth S (@svn1199).</description>
    <link>https://dev.to/svn1199</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%2F3259606%2F3d14b2b8-81ad-4523-a865-2b4578927bd9.png</url>
      <title>DEV Community: Vasanth S</title>
      <link>https://dev.to/svn1199</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/svn1199"/>
    <language>en</language>
    <item>
      <title>Understanding Promise vs Promise.all() in JavaScript</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Fri, 26 Sep 2025 15:24:44 +0000</pubDate>
      <link>https://dev.to/svn1199/understanding-promise-vs-promiseall-in-javascript-4ng7</link>
      <guid>https://dev.to/svn1199/understanding-promise-vs-promiseall-in-javascript-4ng7</guid>
      <description>&lt;p&gt;In &lt;strong&gt;JavaScript&lt;/strong&gt;,&lt;br&gt;
&lt;strong&gt;Promises&lt;/strong&gt; help handle asynchronous operation in clean and structured way. When works with multiple asynchronous tasks, managing them individually can be tricky.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promise.all()&lt;/strong&gt; runs a multiple promises in parallel and handle all their results together.&lt;/p&gt;




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

&lt;p&gt;A &lt;strong&gt;Promise&lt;/strong&gt; is an object that represents eventual completion or failure of an asynchronous operation.&lt;/p&gt;

&lt;p&gt;It can be in one of three states &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pending&lt;/strong&gt; – initial state, neither fulfilled nor   rejected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fulfilled&lt;/strong&gt; – the operation completed successfully.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rejected&lt;/strong&gt; – the operation failed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const promise = new Promise((resolve, reject) =&amp;gt; {
    setTimeout(() =&amp;gt; {
        resolve("Success!");
        // reject("Error!");
    }, 1000);
});

promise.then(result =&amp;gt; console.log(result))
       .catch(error =&amp;gt; console.log(error));

//Here, a single asynchronous task is being handled.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Promise.all()&lt;/strong&gt; is method that takes an array of promises and returns new promise that resolves when all of the promises resolve, or rejects if any one promise rejects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key points:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waits for all promises to finish.&lt;/li&gt;
&lt;li&gt;Returns results in the same order as the input promises.&lt;/li&gt;
&lt;li&gt;Fails fast if any promise rejects.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const promise1 = Promise.resolve(1);
const promise2 = new Promise(resolve =&amp;gt; setTimeout(() =&amp;gt; resolve(2), 1000));
const promise3 = Promise.resolve(3);

Promise.all([promise1, promise2, promise3])
       .then(results =&amp;gt; console.log(results)) // [1, 2, 3]
       .catch(error =&amp;gt; console.log(error));

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

&lt;/div&gt;






&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;code&gt;Promise&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;Promise.all()&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input&lt;/td&gt;
&lt;td&gt;Single async operation&lt;/td&gt;
&lt;td&gt;Array of promises&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;Result of one operation&lt;/td&gt;
&lt;td&gt;Array of all results&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rejection&lt;/td&gt;
&lt;td&gt;One promise fails, only it fails&lt;/td&gt;
&lt;td&gt;Any one promise fails, entire rejects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use case&lt;/td&gt;
&lt;td&gt;Single async task&lt;/td&gt;
&lt;td&gt;Multiple async tasks in parallel&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>node</category>
    </item>
    <item>
      <title>Understanding express.json() in Express.js</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Fri, 26 Sep 2025 11:41:19 +0000</pubDate>
      <link>https://dev.to/svn1199/understanding-expressjson-in-expressjs-1o1p</link>
      <guid>https://dev.to/svn1199/understanding-expressjson-in-expressjs-1o1p</guid>
      <description>&lt;ul&gt;
&lt;li&gt;When building a backend application with express, handling   a incoming request data is common.&lt;/li&gt;
&lt;li&gt;One of the most frequently used type of data is JSON.&lt;/li&gt;
&lt;li&gt;This is where express comes to play.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;express.json()&lt;/strong&gt; reads JSON data in the incoming request body and converts into Javascript Object that can easily access in route handlers.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Do We Need express.json()?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTP requests often send data in the body, especially in POST requests. Without parsing, Express doesn’t automatically understand JSON format. &lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "Vasanth",
  "email": "vasanth@example.com"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If try to access req.body without using express.json(), it will be undefined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post('/users', (req, res) =&amp;gt; {
    console.log(req.body.name); // Works only if express.json() is used
    res.send('User received');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;How to Use express.json()&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 express = require('express');
const app = express();

// Middleware to parse JSON data
app.use(express.json());

app.post('/users', (req, res) =&amp;gt; {
    const user = req.body;
    res.send(`User ${user.name} with email ${user.email} added successfully!`);
});

app.listen(8000, () =&amp;gt; {
    console.log('Server running on port 8000');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>express</category>
      <category>node</category>
      <category>javascript</category>
      <category>json</category>
    </item>
    <item>
      <title>Middleware in Express.js – A Complete Guide</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Fri, 26 Sep 2025 11:26:01 +0000</pubDate>
      <link>https://dev.to/svn1199/middleware-in-expressjs-a-complete-guide-2mkc</link>
      <guid>https://dev.to/svn1199/middleware-in-expressjs-a-complete-guide-2mkc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Middleware&lt;/strong&gt; are function that runs between request from the client and response from the server.&lt;/p&gt;

&lt;p&gt;Each middleware function has access to :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;req&lt;/strong&gt; - request object&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;res&lt;/strong&gt;- response object&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;next()&lt;/strong&gt; - a function that pass control to next middleware.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Signature of middleware function&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;function middlewareName(req, res, next) {
  // Do something
  next(); // move to next middleware
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if forgot to call next(), the request-response cycle will hang.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Express has 5 types of middleware:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application-level&lt;/li&gt;
&lt;li&gt;Router-level&lt;/li&gt;
&lt;li&gt;Built-in&lt;/li&gt;
&lt;li&gt;Third-party&lt;/li&gt;
&lt;li&gt;Error-handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Application-level middleware&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bound to an app object using app.use() or app.METHOD().&lt;/li&gt;
&lt;li&gt;Runs for every request or specific routes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use((req, res, next) =&amp;gt; {
  console.log("Application middleware executed");
  next();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Router-level Middleware&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Works the same as application-level, but bound to an express.Router() instance.&lt;/li&gt;
&lt;li&gt;Useful for modular route handling.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const router = express.Router();
router.use((req, res, next) =&amp;gt; {
  console.log("Router middleware executed");
  next();
});
app.use("/api", router);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Built-in Middleware&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Comes with Express by default.&lt;/p&gt;

&lt;p&gt;Common ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;express.json()&lt;/strong&gt; → parse JSON body&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;express.urlencoded()&lt;/strong&gt; → parse form data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;express.static()&lt;/strong&gt; → serve static files
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(express.json());
app.use(express.static("public"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Third-party Middleware&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installed via npm to add extra features.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;morgan&lt;/strong&gt; → request logging&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cookie-parser&lt;/strong&gt; → parse cookies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cors&lt;/strong&gt; → handle cross-origin requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;helmet&lt;/strong&gt; → security headers
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const morgan = require("morgan");
app.use(morgan("dev"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Error-handling Middleware&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Special middleware with 4 parameters: 
(err, req, res, next).&lt;/li&gt;
&lt;li&gt;Used to handle errors globally.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use((err, req, res, next) =&amp;gt; {
  console.error(err.message);
  res.status(500).send("Something broke!");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>express</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is the DOM in JavaScript?</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Tue, 05 Aug 2025 18:05:42 +0000</pubDate>
      <link>https://dev.to/svn1199/what-is-the-dom-in-javascript-4nj</link>
      <guid>https://dev.to/svn1199/what-is-the-dom-in-javascript-4nj</guid>
      <description>&lt;p&gt;The &lt;strong&gt;DOM (Document Object Model)&lt;/strong&gt; is a programming interface that makes a website interactive and dynamic by allowing JavaScript to work with HTML and CSS.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The DOM turns your web page into a tree of objects that JavaScript can read, modify, or remove.&lt;/p&gt;
&lt;/blockquote&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;&amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;
&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;document.querySelector('h1').textContent = "Hello JavaScript!";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Why DOM is important?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change text, images, and styles&lt;/li&gt;
&lt;li&gt;Handle user clicks and events&lt;/li&gt;
&lt;li&gt;Add or remove elements&lt;/li&gt;
&lt;li&gt;Build dynamic, interactive websites&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JavaScript Data Types Simplified</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Tue, 05 Aug 2025 17:56:44 +0000</pubDate>
      <link>https://dev.to/svn1199/javascript-data-types-simplified-d60</link>
      <guid>https://dev.to/svn1199/javascript-data-types-simplified-d60</guid>
      <description>&lt;p&gt;&lt;strong&gt;JavaScript Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript has two main types: &lt;br&gt;
&lt;strong&gt;Primitive and Non-Primitive (Reference)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Primitive Data Types&lt;/strong&gt; - These store single values and are immutable.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;String&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Text data&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"Hello"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Number&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Numeric values&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;42&lt;/code&gt;, &lt;code&gt;3.14&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;True or false&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;true&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Null&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Intentional empty value&lt;/td&gt;
&lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Undefined&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Variable not assigned&lt;/td&gt;
&lt;td&gt;&lt;code&gt;undefined&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BigInt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large integers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;12345678901234567890n&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Symbol&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unique identifier&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Symbol("id")&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Non-Primitive (Reference) Data Types&lt;/strong&gt; - These store collections or complex data.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Object&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Key-value pairs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;{ name: "Vasanth", age: 25 }&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Array&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List-like objects&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[1, 2, 3]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Function&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reusable blocks of code&lt;/td&gt;
&lt;td&gt;&lt;code&gt;function greet() {}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are the data types used in JavaScript. I will explain each of them in detail in upcoming posts.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>CSS Selectors: Definitions and Examples</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Tue, 05 Aug 2025 17:49:09 +0000</pubDate>
      <link>https://dev.to/svn1199/css-selectors-definitions-and-examples-do</link>
      <guid>https://dev.to/svn1199/css-selectors-definitions-and-examples-do</guid>
      <description>&lt;p&gt;CSS Selectors are used to find or select HTML element that you want to style&lt;/p&gt;

&lt;p&gt;These are divided into categories&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Universal Selectors&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Selects all elements on the page&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;* {
  margin: 0;
  padding: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Type Selector (element)&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Selects all elements of the specified type.&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;p { color: blue; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Class Selector (.classname)&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Selects all elements with a specific class.&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;.box { border: 1px solid black; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;ID Selector (#idname)&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Selects the element with the specific ID.&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;#header { font-size: 20px; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Grouping Selector (A, B)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Applies the same styles to multiple selectors.&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;h1, h2, p { color: green; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Descendant Selector (A B)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements inside another element.&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;div p { font-style: italic; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Child Selector (A &amp;gt; B)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects direct child elements only.&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;ul &amp;gt; li { list-style-type: circle; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Adjacent Sibling Selector (A + B)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects the element immediately after the specified one.&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;h2 + p { color: red; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;General Sibling Selector (A ~ B)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects all siblings after a specified element.&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;h2 ~ p { font-weight: bold; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Attribute Selector ([attr])&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements with the given attribute.&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;input[required] { border: 1px solid red; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Attribute with Value ([attr="value"])&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements with a specific attribute value.&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;input[type="text"] { width: 150px; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Pseudo-class Selector (:pseudo-class)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements in a specific state or condition.&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;a:hover { color: orange; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;Pseudo-element Selector (::pseudo-element)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Styles specific parts of an element.&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;p::first-letter { font-size: 30px; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:first-child Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects the first child of its parent.&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;li:first-child { color: blue; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:last-child Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects the last child of its parent.&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;li:last-child { color: red; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:nth-child(n) Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects the nth child of its parent.&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;li:nth-child(2) { background: yellow; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:not(selector) Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements that don’t match the given selector.&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;p:not(.info) { color: black; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:checked Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects checked checkboxes or radio buttons.&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;input:checked { outline: 2px solid green; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:disabled and :enabled&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects form elements based on whether they are disabled or enabled.&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;input:disabled { background: #eee; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;:empty Selector&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Selects elements with no children or text.&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;div:empty { display: none; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above content is just an introduction to the CSS selectors I know. If I learn anything new, I will share it later. Thank you for reading and for your patience.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Essential JavaScript Methods You must Know</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Wed, 30 Jul 2025 12:04:31 +0000</pubDate>
      <link>https://dev.to/svn1199/essential-javascript-methods-you-must-know-3kj6</link>
      <guid>https://dev.to/svn1199/essential-javascript-methods-you-must-know-3kj6</guid>
      <description>&lt;p&gt;JavaScript provides many built-in methods that make coding easier. Here are some of the most commonly used methods with their definitions, syntax, and examples.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;toUpperCase&lt;/strong&gt;()&lt;/u&gt; - Converts a string to uppercase letters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;string.toUpperCase()&lt;/code&gt;&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;let name = "hello";
console.log(name.toUpperCase()); // Output: "HELLO"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;toLowerCase()&lt;/strong&gt;&lt;/u&gt; - Converts a string to lowercase letters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;string.toLowerCase()&lt;/code&gt;&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;let name = "HELLO";
console.log(name.toLowerCase()); // Output: "hello"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;trim()&lt;/u&gt;&lt;/strong&gt; - Removes whitespace from both ends of a string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;string.trim()&lt;/code&gt;&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;let text = "   Hello World!   ";
console.log(text.trim()); // Output: "Hello World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;includes()&lt;/u&gt;&lt;/strong&gt; - Checks if a string contains a specific substring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;string.includes(searchValue)&lt;/code&gt;&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;let sentence = "JavaScript is powerful";
console.log(sentence.includes("powerful")); // Output: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;u&gt;&lt;strong&gt;push()&lt;/strong&gt;&lt;/u&gt; - Adds new elements to the end of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.push(element1, element2, ...)&lt;/code&gt;&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;let numbers = [1, 2, 3];
numbers.push(4);
console.log(numbers); // Output: [1, 2, 3, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;pop()&lt;/u&gt;&lt;/strong&gt; - Removes the last element from an array and returns it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.pop()&lt;/code&gt;&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;let fruits = ["apple", "banana", "mango"];
fruits.pop();
console.log(fruits); // Output: ["apple", "banana"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;shift()&lt;/u&gt;&lt;/strong&gt; - Removes the first element from an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.shift()&lt;/code&gt;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let colors = ["red", "green", "blue"];
colors.shift();
console.log(colors); // Output: ["green", "blue"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;unshift()&lt;/u&gt;&lt;/strong&gt; - Adds new elements to the beginning of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;array.unshift(element1, element2, ...)&lt;/code&gt;&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;let cars = ["BMW", "Audi"];
cars.unshift("Tesla");
console.log(cars); // Output: ["Tesla", "BMW", "Audi"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;slice()&lt;/u&gt;&lt;/strong&gt; - Returns a shallow copy of a portion of an array or string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.slice(start, end)&lt;/code&gt;&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;let animals = ["cat", "dog", "rabbit", "lion"];
console.log(animals.slice(1, 3)); // Output: ["dog", "rabbit"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;splice()&lt;/u&gt;&lt;/strong&gt; -  Adds/removes elements from an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.splice(start, deleteCount, item1, item2, ...)&lt;/code&gt;&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;let items = ["pen", "pencil", "eraser"];
items.splice(1, 1, "marker");
console.log(items); // Output: ["pen", "marker", "eraser"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;map()&lt;/u&gt;&lt;/strong&gt; - Creates a new array by applying a function to each element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.map(callback)&lt;/code&gt;&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;let nums = [1, 2, 3];
let squared = nums.map(n =&amp;gt; n * n);
console.log(squared); // Output: [1, 4, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;filter()&lt;/u&gt;&lt;/strong&gt; - Returns elements of an array that satisfy a condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
array.filter(callback)&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;let ages = [12, 18, 25, 30];
let adults = ages.filter(age =&amp;gt; age &amp;gt;= 18);
console.log(adults); // Output: [18, 25, 30]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;reduce()&lt;/u&gt;&lt;/strong&gt; - Reduces an array to a single value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.reduce(callback, initialValue)&lt;/code&gt;&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;let nums = [1, 2, 3, 4];
let sum = nums.reduce((total, n) =&amp;gt; total + n, 0);
console.log(sum); // Output: 10

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

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;forEach()&lt;/u&gt;&lt;/strong&gt; - Executes a function for each array element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.forEach(callback)&lt;/code&gt;&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;let fruitsList = ["apple", "mango", "orange"];
fruitsList.forEach(fruit =&amp;gt; console.log(fruit));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;sort()&lt;/u&gt;&lt;/strong&gt; - Sorts elements of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;array.sort(compareFunction)&lt;/code&gt;&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;let numbersList = [4, 2, 9, 1];
numbersList.sort((a, b) =&amp;gt; a - b);
console.log(numbersList); // Output: [1, 2, 4, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;indexOf()&lt;/u&gt;&lt;/strong&gt; - Returns the index of the first occurrence of an element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;array.indexOf(element)&lt;/code&gt;&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;let langs = ["JS", "Python", "C"];
console.log(langs.indexOf("Python")); // Output: 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;u&gt;replace()&lt;/u&gt;&lt;/strong&gt; - Replaces a substring with another in a string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax :&lt;/strong&gt;&lt;br&gt;
string.replace(searchValue, newValue)&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;let greet = "Hello World";
console.log(greet.replace("World", "JS")); // Output: "Hello JS"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So here are the methods most commonly used by developers. Thanks for reading! See you soon with another exciting topic.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How JSON.stringify() Works in JavaScript</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Wed, 30 Jul 2025 06:29:57 +0000</pubDate>
      <link>https://dev.to/svn1199/how-jsonstringify-works-in-javascript-34dj</link>
      <guid>https://dev.to/svn1199/how-jsonstringify-works-in-javascript-34dj</guid>
      <description>&lt;p&gt;&lt;strong&gt;JSON.stringify()&lt;/strong&gt; is Javascript built-in method that converts Javascript object or value into JSON string.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;syntax&lt;/strong&gt; of JSON.stringify is&lt;br&gt;
JSON.stringify(value, replacer, space)&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;value&lt;/strong&gt; – The object or value to convert.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;replacer (optional)&lt;/strong&gt; – A function or array that filters properties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;space (optional)&lt;/strong&gt; – Adds indentation, spaces, or line breaks for readability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Do We Use JSON.stringify()?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;To send data to APIs&lt;/strong&gt; -  Most APIs expect data in JSON format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To store data&lt;/strong&gt; -  When saving object in localstorage or database, they must be string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To debug easily&lt;/strong&gt; - It’s helpful to see object structures as strings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Case&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("/api/save", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name: "David", email: "david@example.com" })
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>json</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding the Compiler and Interpreter</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Mon, 07 Jul 2025 17:28:08 +0000</pubDate>
      <link>https://dev.to/svn1199/understanding-the-compiler-and-interpreter-3f9n</link>
      <guid>https://dev.to/svn1199/understanding-the-compiler-and-interpreter-3f9n</guid>
      <description>&lt;p&gt;A &lt;strong&gt;Compiler&lt;/strong&gt; and an &lt;strong&gt;Interpreter&lt;/strong&gt; are both used to convert high-level programming code into machine language.&lt;br&gt;
They work differently in how and when they translate the code.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Compiler &lt;strong&gt;translates&lt;/strong&gt; the entire code into machine code at once.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;converts&lt;/strong&gt; high level code into executable files.&lt;/li&gt;
&lt;li&gt;After compilation, the program can run without using compiler.&lt;/li&gt;
&lt;li&gt;Compilation usually takes time before execution starts.&lt;/li&gt;
&lt;li&gt;If any error occurs in entire code it will shown after the whole code is compiled.&lt;/li&gt;
&lt;li&gt;It makes the programs run faster after compilation.&lt;/li&gt;
&lt;li&gt;Compiler check the entire code for syntax error at once.&lt;/li&gt;
&lt;li&gt;Once compiled, you can run the program multiple times quickly.&lt;/li&gt;
&lt;li&gt;It is suitable for large programs that require performance.&lt;/li&gt;
&lt;li&gt;Examples of compiled languages: &lt;strong&gt;C&lt;/strong&gt;, &lt;strong&gt;C++&lt;/strong&gt;, &lt;strong&gt;Java&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;An interpreter &lt;strong&gt;translates&lt;/strong&gt; and runs code &lt;strong&gt;line by line&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It doesn’t create a separate executable file.&lt;/li&gt;
&lt;li&gt;The program runs directly, starting from the first line.&lt;/li&gt;
&lt;li&gt;If any error occurs in entire code it will shown immediately when the faulty line runs.&lt;/li&gt;
&lt;li&gt;It is slower than a compiler because it translates in real-time.&lt;/li&gt;
&lt;li&gt;Interpreted code is easier to &lt;strong&gt;test&lt;/strong&gt; and &lt;strong&gt;debug&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Code needs the interpreter every time it runs.&lt;/li&gt;
&lt;li&gt;It’s great for beginners and quick script testing.&lt;/li&gt;
&lt;li&gt;It’s ideal for small programs and learning purposes.&lt;/li&gt;
&lt;li&gt;Examples of interpreted languages: &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;JavaScript&lt;/strong&gt;, &lt;strong&gt;PHP&lt;/strong&gt;.&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%2Fckfwaxcf1h2xzx1yw7l6.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%2Fckfwaxcf1h2xzx1yw7l6.png" alt=" " width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion :&lt;/strong&gt;&lt;br&gt;
Both &lt;strong&gt;compiler&lt;/strong&gt; and &lt;strong&gt;interpreter&lt;/strong&gt; have their own advantages based on the use case.&lt;br&gt;
Understanding their differences helps in choosing the right tool for programming.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Uncovered - A Simple Introduction</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Mon, 07 Jul 2025 17:10:24 +0000</pubDate>
      <link>https://dev.to/svn1199/javascript-uncovered-a-simple-introduction-192j</link>
      <guid>https://dev.to/svn1199/javascript-uncovered-a-simple-introduction-192j</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt; was introduced by &lt;strong&gt;Brendan Eich&lt;/strong&gt; in &lt;strong&gt;1995&lt;/strong&gt; while he was working at &lt;strong&gt;Netscape Communications&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It was originally developed in just &lt;strong&gt;10 days&lt;/strong&gt; .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The first name of JavaScript was &lt;strong&gt;Mocha&lt;/strong&gt;, later renamed to &lt;strong&gt;LiveScript&lt;/strong&gt;, and finally to JavaScript for &lt;strong&gt;marketing reasons&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt; is a programming language which is doing some magic in the software world. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From &lt;strong&gt;website&lt;/strong&gt; to &lt;strong&gt;servers&lt;/strong&gt;, &lt;strong&gt;mobile apps&lt;/strong&gt; to &lt;strong&gt;games&lt;/strong&gt; - today, it rules all the domains in software industry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is widely used to make and build &lt;strong&gt;interactive web applications&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It &lt;strong&gt;brings life&lt;/strong&gt; to static web pages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is the most &lt;strong&gt;essential language&lt;/strong&gt; for front-end development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It runs directly in the browser, without needing installation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It supported all &lt;strong&gt;modern web browsers&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can handle &lt;strong&gt;databases&lt;/strong&gt;, &lt;strong&gt;APIs&lt;/strong&gt;, and &lt;strong&gt;back-end&lt;/strong&gt; logic too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Popular libraries like &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Vue&lt;/strong&gt;, and &lt;strong&gt;Angular&lt;/strong&gt; are based on JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It supports various programming styles — &lt;strong&gt;functional&lt;/strong&gt;, &lt;strong&gt;object-oriented&lt;/strong&gt;, and &lt;strong&gt;event-driven&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Its simple syntax makes it &lt;strong&gt;beginner-friendly&lt;/strong&gt; and &lt;strong&gt;easy to learn&lt;/strong&gt; .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With constant updates, it keeps growing &lt;strong&gt;stronger&lt;/strong&gt; and  &lt;strong&gt;more powerful&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In short, JavaScript is the &lt;strong&gt;magic wand&lt;/strong&gt; of the modern tech world.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>mobile</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Static vs Dynamic Typed Programming Language</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Mon, 07 Jul 2025 16:42:35 +0000</pubDate>
      <link>https://dev.to/svn1199/static-vs-dynamic-typed-programming-language-37pe</link>
      <guid>https://dev.to/svn1199/static-vs-dynamic-typed-programming-language-37pe</guid>
      <description>&lt;p&gt;&lt;strong&gt;Static&lt;/strong&gt; and &lt;strong&gt;Dynamic&lt;/strong&gt; typing are ways programming languages handle variable types.&lt;/p&gt;

&lt;p&gt;Static checks types before running the program; &lt;br&gt;
Dynamic checks types while running it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Typed Language :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variable have fixed types and types should be declared.&lt;/li&gt;
&lt;li&gt;Checking the type at compile time.&lt;/li&gt;
&lt;li&gt;Many error caught during compiling time.&lt;/li&gt;
&lt;li&gt;It gives better performance because it's optimized due to known types and it's generally faster. &lt;/li&gt;
&lt;li&gt;Code is more predictable, types remains constant, improving coding reliability.&lt;/li&gt;
&lt;li&gt;It has less flexible.&lt;/li&gt;
&lt;li&gt;Examples of Programming Languages are Java, C, C++, Kotlin, Rust&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Dynamic Typed Language :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variable types are determined and checked while the program runs.&lt;/li&gt;
&lt;li&gt;Variables can be assigned without declaring data types.&lt;/li&gt;
&lt;li&gt;It caught more runtime error.&lt;/li&gt;
&lt;li&gt;It gives slower performance because extra work is needed at runtime to manage types.&lt;/li&gt;
&lt;li&gt;Less syntax and setup required for simple programs.&lt;/li&gt;
&lt;li&gt;It has more flexible.&lt;/li&gt;
&lt;li&gt;Examples of Programming Languages are JavaScript, Python, Ruby, PHP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion :&lt;/strong&gt;&lt;br&gt;
Choosing between static and dynamic typed language depends on project needs.&lt;br&gt;
Static offers better performance and safety, while dynamic offers flexibility and ease of use.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>softwaredevelopment</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Overview : Software Development Life Cycle (SDLC)</title>
      <dc:creator>Vasanth S</dc:creator>
      <pubDate>Mon, 07 Jul 2025 16:10:09 +0000</pubDate>
      <link>https://dev.to/svn1199/overview-software-development-life-cycle-sdlc-4nd0</link>
      <guid>https://dev.to/svn1199/overview-software-development-life-cycle-sdlc-4nd0</guid>
      <description>&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%2Fh3z4ofj9a5o2a2t79tfs.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%2Fh3z4ofj9a5o2a2t79tfs.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Software Development Life cycle (SDLC)&lt;/strong&gt; is a structured process, methodology and it defines the procedure of entire software development step by step.&lt;/p&gt;

&lt;p&gt;It used to &lt;strong&gt;design&lt;/strong&gt;, &lt;strong&gt;develop&lt;/strong&gt; and &lt;strong&gt;test&lt;/strong&gt; for software to become quality.&lt;/p&gt;

&lt;p&gt;The goal of the SDLC is to delivers the &lt;strong&gt;high quality&lt;/strong&gt;, &lt;strong&gt;maintainable software&lt;/strong&gt; that meets the users requirements.&lt;/p&gt;

&lt;p&gt;SDLC involved &lt;strong&gt;six phases&lt;/strong&gt; and &lt;strong&gt;stage&lt;/strong&gt; while developing any software.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Planning and Requirements&lt;/strong&gt; - To plan the requirements of software that is what should it do, why it is needed. Involves collects ideas and business needs rom users or clients, defining scopes and goals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Analysis&lt;/strong&gt; - Detailed requirements are analyzed for feasibility and clarity. Understand the problems and solutions. This helps in identifying technical, operational, and financial constraints. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System Design&lt;/strong&gt; - Make a plan how the software will look and work. Make the screen, databases and system flow. It acts as a blueprint for how the system will function and look.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Development&lt;/strong&gt; - Write the code based on the design specifications. The Team creates features as the software planned in design.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt; - Testing the developed software features an to find if any error or bugs which will be fixed and make sure it works well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deployment and Maintenance&lt;/strong&gt; - Completed the development and testing, the software ready to use for people use or deploy. After deployment, it is improved by adding features and fixing any bugs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More than 50 recognized models in use for SDLC. But none of them is perfect each bring various aspects and disadvantages.&lt;br&gt;
Here is the top five models are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waterfall Model&lt;/li&gt;
&lt;li&gt;Agile Model&lt;/li&gt;
&lt;li&gt;V Shaped Model&lt;/li&gt;
&lt;li&gt;Spiral Model&lt;/li&gt;
&lt;li&gt;Iterative Model&lt;/li&gt;
&lt;li&gt;Big Bang Model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Benefits of SDLC&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helps in planning the project properly.&lt;/li&gt;
&lt;li&gt;Makes the goals and steps clear for everyone.&lt;/li&gt;
&lt;li&gt;Improves the quality of the software.&lt;/li&gt;
&lt;li&gt;Saves time and money by avoiding mistakes.&lt;/li&gt;
&lt;li&gt;Makes the project easier to manage.&lt;/li&gt;
&lt;li&gt;Helps teams and clients understand the work.&lt;/li&gt;
&lt;li&gt;Finds problems early and reduces risk.&lt;/li&gt;
&lt;li&gt;Allows regular updates and improvements.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sdlc</category>
      <category>softwaredevelopment</category>
      <category>scrum</category>
      <category>development</category>
    </item>
  </channel>
</rss>
