<?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: Narmatha</title>
    <description>The latest articles on DEV Community by Narmatha (@narmathachandra).</description>
    <link>https://dev.to/narmathachandra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4020834%2F7b160354-0b89-408e-baad-e9192d63ca87.png</url>
      <title>DEV Community: Narmatha</title>
      <link>https://dev.to/narmathachandra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/narmathachandra"/>
    <language>en</language>
    <item>
      <title>REACT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Wed, 23 Sep 2026 15:57:36 +0000</pubDate>
      <link>https://dev.to/narmathachandra/react-3ch9</link>
      <guid>https://dev.to/narmathachandra/react-3ch9</guid>
      <description>&lt;h2&gt;
  
  
  What is React?
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*React is a JavaScript library used for building user interfaces (UI), especially for web applications.&lt;br&gt;
*It was originally developed by Facebook (now Meta). React helps you build a website using small, reusable pieces called components.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  For example:&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;1.Navbar&lt;br&gt;
2.Button&lt;br&gt;
3.LoginForm&lt;br&gt;
4.ProductCard&lt;br&gt;
5.Footer&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Example:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function Welcome() {&lt;br&gt;
  return (&lt;br&gt;
    &amp;lt;div&amp;gt;&lt;br&gt;
      &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;&lt;br&gt;
      &amp;lt;p&amp;gt;Welcome to my React application.&amp;lt;/p&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;export default Welcome;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we use React?
&lt;/h2&gt;

&lt;p&gt;The main reason is that modern websites often need to change their UI dynamically without reloading the entire page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important React concepts:
&lt;/h2&gt;

&lt;p&gt;Component - Reusable piece of UI&lt;br&gt;
JSS - Syntax that lets you write HTML-like code in JavaScript&lt;br&gt;
Props - Data passed from one component to another&lt;br&gt;
State - Data that can change while the application is running&lt;br&gt;
Hooks - Functions such as useState and useEffect that add functionality to components&lt;br&gt;
Virtual DOM - React's mechanism for efficiently updating the UI&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ClOSURES IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Thu, 10 Sep 2026 15:30:15 +0000</pubDate>
      <link>https://dev.to/narmathachandra/closures-in-javascript-1cp5</link>
      <guid>https://dev.to/narmathachandra/closures-in-javascript-1cp5</guid>
      <description>&lt;h2&gt;
  
  
  WHAT IS CLOSURES IN JAVASCRIPT?
&lt;/h2&gt;

&lt;p&gt;A closure is when a function remembers and has access to variables from its outer scope even after the outer function has finished executing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple example
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function outer() {&lt;br&gt;
    let name = "John";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function inner()&lt;/code&gt;&lt;code&gt;{&lt;br&gt;
        console.log(name);&lt;br&gt;
    }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;return inner;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;const myFunction = outer();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;myFunction();&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;John&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  why does this work?
&lt;/h2&gt;

&lt;p&gt;Normally, you might think name should disappear after outer() finishes.&lt;/p&gt;

&lt;p&gt;But inner() remembers the name variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;outer()
  |
  |-- name = "John"
  |
  |-- inner()
        |
        |-- remembers "John"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That remembering ability is called a closure.&lt;/p&gt;

&lt;h2&gt;
  
  
  One more useful example
&lt;/h2&gt;

&lt;p&gt;Closures are often used to create private variables:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function counter() {&lt;br&gt;
    let count = 0;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;return function () {&lt;br&gt;
        count++;&lt;br&gt;
        console.log(count);&lt;br&gt;
    };&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;const myCounter = counter();&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;myCounter(); // 1&lt;br&gt;
myCounter(); // 2&lt;br&gt;
myCounter(); // 3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Even though counter() has already finished, the returned function still remembers count.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;p&gt;Closure = A function + the variables from its surrounding environment that it remembers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PROMISES IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Thu, 10 Sep 2026 15:19:57 +0000</pubDate>
      <link>https://dev.to/narmathachandra/promises-in-javascript-4ple</link>
      <guid>https://dev.to/narmathachandra/promises-in-javascript-4ple</guid>
      <description>&lt;h2&gt;
  
  
  What is a Promise in JavaScript?
&lt;/h2&gt;

&lt;p&gt;A Promise is an object that represents the future result of an asynchronous operation.&lt;/p&gt;

&lt;p&gt;For example, when you request data from an API, JavaScript doesn't want to stop your entire program while waiting for the server. A Promise represents that waiting operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Promise has 3 states
&lt;/h2&gt;

&lt;p&gt;1.Pending — operation is still running.&lt;br&gt;
2.Fulfilled — operation completed successfully.&lt;br&gt;
3.Rejected — operation failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  SIMPLE EXAMPLE:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;const promise = new Promise((resolve, reject) =&amp;gt; {&lt;br&gt;
    let success = true;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;if (success) {&lt;br&gt;
        resolve("Data received!");&lt;br&gt;
    }&lt;/code&gt; &lt;code&gt;else {&lt;br&gt;
        reject("Something went wrong!");&lt;br&gt;
    }&lt;br&gt;
});&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here:
&lt;/h2&gt;

&lt;p&gt;*resolve() → success&lt;br&gt;
*reject() → failure&lt;br&gt;
You can consume the Promise using .then() and .catch():&lt;/p&gt;

&lt;p&gt;&lt;code&gt;promise&lt;br&gt;
    .then((result) =&amp;gt; {&lt;br&gt;
        console.log(result);&lt;br&gt;
    })&lt;br&gt;
&lt;/code&gt;    &lt;code&gt;.catch((error) =&amp;gt; {&lt;br&gt;
        console.log(error);&lt;br&gt;
    });&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Data received!&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JUST A SIMPLE EXAMPLE:
&lt;/h2&gt;

&lt;p&gt;Imagine you order food 🍕.&lt;/p&gt;

&lt;p&gt;When you place the order, the restaurant doesn't immediately give you the food.&lt;/p&gt;

&lt;p&gt;The order is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Pending&lt;br&gt;
   ↓&lt;br&gt;
Food prepared successfully → Fulfilled&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
or:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Pending&lt;br&gt;
   ↓&lt;br&gt;
Restaurant couldn't prepare it → Rejected&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The Promise is like the restaurant saying:&lt;/p&gt;

&lt;p&gt;"Your food will be ready later."&lt;/p&gt;

&lt;h2&gt;
  
  
  WHY DO WE NEED PROMISE:
&lt;/h2&gt;

&lt;p&gt;We need Promises in JavaScript because some tasks take time, like getting data from a server. JavaScript can start that task and continue doing other work instead of waiting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple example
&lt;/h2&gt;

&lt;p&gt;Imagine you ask a server for user data:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log("Start");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fetch("https://example.com/users")&lt;br&gt;
  .then(response =&amp;gt; response.json())&lt;br&gt;
  .then(data =&amp;gt;&lt;/code&gt; &lt;code&gt;{&lt;br&gt;
    console.log(data);&lt;br&gt;
  });&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;The output will be roughly:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Start&lt;br&gt;
End&lt;br&gt;
[user data]&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;fetch() takes time. Instead of stopping the program and waiting, JavaScript says:&lt;/p&gt;

&lt;p&gt;"I'll give you the data when it's ready."&lt;/p&gt;

&lt;p&gt;That's what the Promise represents.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CALLBACKFUNCTION</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 08 Sep 2026 15:45:00 +0000</pubDate>
      <link>https://dev.to/narmathachandra/callbackfunction-4e9n</link>
      <guid>https://dev.to/narmathachandra/callbackfunction-4e9n</guid>
      <description>&lt;h2&gt;
  
  
  Callback Function in JavaScript
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function greet(name, callback) {&lt;br&gt;
    console.log("Hello " + name);&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
   &lt;code&gt;callback();&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;function sayBye() {&lt;br&gt;
    console.log("Goodbye!");&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;greet("John", sayBye);&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;Hello John&lt;br&gt;
Goodbye!&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Use Callback Functions?
&lt;/h2&gt;

&lt;p&gt;Callbacks are useful when we want to say:&lt;/p&gt;

&lt;p&gt;"After this task is completed, execute this function."&lt;/p&gt;

&lt;p&gt;This is especially important in JavaScript because JavaScript frequently performs asynchronous operations.&lt;/p&gt;

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

&lt;p&gt;*Waiting for a timer&lt;br&gt;
*Getting data from a server&lt;br&gt;
*Reading a file&lt;br&gt;
*Handling a button click&lt;br&gt;
*Processing events&lt;/p&gt;

&lt;h2&gt;
  
  
  Callback vs Normal Function
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Normal function:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function add(a, b) {&lt;br&gt;
    return a + b;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log(add(10, 20));&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can directly calling the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Callback Function:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function calculate(a, b, callback) {&lt;br&gt;
    let result = a + b;&lt;br&gt;
    callback(result);&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;calculate(10, 20, function(result) {&lt;br&gt;
    console.log(result);&lt;br&gt;
});&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Here the function is passed to another function.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>FUNCTIONS IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 08 Sep 2026 15:27:57 +0000</pubDate>
      <link>https://dev.to/narmathachandra/functions-in-javascript-2655</link>
      <guid>https://dev.to/narmathachandra/functions-in-javascript-2655</guid>
      <description>&lt;h2&gt;
  
  
  What Is a Function in JavaScript?
&lt;/h2&gt;

&lt;p&gt;A function in JavaScript is a reusable block of code that performs a particular task.&lt;/p&gt;

&lt;p&gt;Instead of writing the same code again and again, we write it once inside a function and call the function whenever we need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Example
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function greet() {&lt;br&gt;
    console.log("Hello!");&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;greet();&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;Hello!&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;p&gt;1.function → keyword used to create a function&lt;br&gt;
2.greet    → function name&lt;br&gt;
3.()       → parameters go here&lt;br&gt;
4.{ }      → contains the code that the function executes&lt;br&gt;
5.greet()  → calls/executes the function&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Use Functions?
&lt;/h2&gt;

&lt;p&gt;The main reason is code reuse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Without a function:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;console.log("Hello John");&lt;br&gt;
console.log("Hello Alice");&lt;br&gt;
console.log("Hello David");&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  With a function:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;function greet(name) {&lt;br&gt;
    console.log("Hello " + name);&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;greet("John");&lt;br&gt;
greet("Alice");&lt;br&gt;
greet("David");&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;Hello John&lt;br&gt;
Hello Alice&lt;br&gt;
Hello David&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Function Without Parameters
&lt;/h2&gt;

&lt;p&gt;A function doesn't always need input.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function sayHello() {&lt;br&gt;
    console.log("Hello World");&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sayHello();&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Function With Parameters
&lt;/h2&gt;

&lt;p&gt;A parameter is a value that the function expects to receive.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function greet(name) {&lt;br&gt;
    console.log("Hello " + name);&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;greet("John");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;is the parameter.&lt;/p&gt;

&lt;p&gt;And:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"John"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;is the argument passed to the function.&lt;/p&gt;

&lt;p&gt;Think of it like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Parameter → placeholder&lt;br&gt;
Argument  → actual value&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;`function add(a, b) {&lt;br&gt;
    console.log(a + b);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;add(10, 20);&lt;br&gt;
`&lt;br&gt;
Output:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;30&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Here:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;a = 10&lt;br&gt;
b = 20&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ARRAYS IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 08 Sep 2026 15:13:21 +0000</pubDate>
      <link>https://dev.to/narmathachandra/arrays-in-javascript-3224</link>
      <guid>https://dev.to/narmathachandra/arrays-in-javascript-3224</guid>
      <description>&lt;h2&gt;
  
  
  Arrays in JavaScript
&lt;/h2&gt;

&lt;p&gt;An array in JavaScript is a special type of object used to store multiple values in a single variable.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;code&gt;let student1 = "John";&lt;br&gt;
let student2 = "Alice";&lt;br&gt;
let student3 = "David";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;we can use an array:&lt;/p&gt;

&lt;p&gt;`let students = ["John", "Alice", "David"];&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
Now all three values are stored inside one variable called students.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why Do We Use Arrays?
&lt;/h2&gt;

&lt;p&gt;Arrays are useful when we have a collection of related data.&lt;/p&gt;

&lt;h2&gt;
  
  
  For example:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let fruits = ["Apple", "Banana", "Mango", "Orange"];&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, fruits contains four values.&lt;/p&gt;

&lt;p&gt;Arrays are commonly used for:&lt;/p&gt;

&lt;p&gt;Storing a list of users&lt;br&gt;
Storing products&lt;br&gt;
Storing marks&lt;br&gt;
Storing names&lt;br&gt;
Storing numbers&lt;br&gt;
Storing objects&lt;br&gt;
Processing data with loops and methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Empty Array
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let fruits = [];&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can add values later:&lt;/p&gt;

&lt;p&gt;`fruits.push("Apple");&lt;br&gt;
fruits.push("Banana");&lt;/p&gt;

&lt;p&gt;console.log(fruits);`&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;["Apple", "Banana"]&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.Array Length
&lt;/h2&gt;

&lt;p&gt;The .length property tells you how many elements are in an array.&lt;/p&gt;

&lt;p&gt;`let fruits = ["Apple", "Banana", "Mango"];&lt;/p&gt;

&lt;p&gt;console.log(fruits.length);&lt;br&gt;
`&lt;br&gt;
Output:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Remember:&lt;/p&gt;

&lt;p&gt;Index starts at 0, but length counts from 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  For example:
&lt;/h2&gt;

&lt;p&gt;`Array length = 3&lt;/p&gt;

&lt;p&gt;Indexes:&lt;br&gt;
0&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
`&lt;br&gt;
The last element can therefore be accessed using:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fruits[fruits.length - 1]&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Arrays in JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript doesn't have separate built-in array classes for every data type like some languages do. A JavaScript Array can contain different kinds of values.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Numeric Array
&lt;/h2&gt;

&lt;p&gt;An array containing numbers:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let numbers = [10, 20, 30, 40, 50];&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. String Array
&lt;/h2&gt;

&lt;p&gt;An array containing strings:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let names = ["John", "Alice", "David"];&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Boolean Array
&lt;/h2&gt;

&lt;p&gt;An array containing boolean values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let results = [true, false, true, true];&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PATTERN IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 08 Sep 2026 14:44:55 +0000</pubDate>
      <link>https://dev.to/narmathachandra/pattern-in-javascript-28o6</link>
      <guid>https://dev.to/narmathachandra/pattern-in-javascript-28o6</guid>
      <description>&lt;h2&gt;
  
  
  Patterns in JavaScript
&lt;/h2&gt;

&lt;p&gt;The word “patterns” in JavaScript usually refers to common, reusable ways of solving programming problems. These are often called design patterns.&lt;/p&gt;

&lt;p&gt;A design pattern is not a ready-made piece of code. Instead, it is a general approach or structure that you can use when you encounter a particular type of problem.&lt;/p&gt;

&lt;p&gt;For example, if many parts of your application need to use the same object, you might use the Singleton Pattern. If an object needs to notify many other objects when something changes, you might use the Observer Pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need patterns?
&lt;/h2&gt;

&lt;p&gt;As JavaScript applications become larger, simply writing functions and classes can become difficult to manage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Patterns help you:
&lt;/h2&gt;

&lt;p&gt;*Organize your code.&lt;br&gt;
*Avoid repeating the same solution.&lt;br&gt;
*Make code easier to maintain.&lt;br&gt;
*Make communication between objects clearer.&lt;br&gt;
*Separate different responsibilities.&lt;br&gt;
*Make applications easier to extend.&lt;br&gt;
*Provide commonly understood solutions to common problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Should We Use Patterns in JavaScript?
&lt;/h2&gt;

&lt;p&gt;We use patterns because they give us proven ways to solve common programming problems.&lt;/p&gt;

&lt;p&gt;Think of a pattern like a blueprint for building software. You don't have to reinvent the solution every time you face the same type of problem.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DOM IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Thu, 03 Sep 2026 16:25:30 +0000</pubDate>
      <link>https://dev.to/narmathachandra/dom-in-javascript-1404</link>
      <guid>https://dev.to/narmathachandra/dom-in-javascript-1404</guid>
      <description>&lt;h2&gt;
  
  
  WHAT IS DOM IN JAVASCRIPT?
&lt;/h2&gt;

&lt;p&gt;DOM stands for Document Object Model.&lt;/p&gt;

&lt;p&gt;The DOM is a programming representation of an HTML page. JavaScript uses the DOM to access, change, add, or remove HTML elements and their content/styles.&lt;/p&gt;

&lt;h2&gt;
  
  
  The browser converts this HTML into a DOM tree:
&lt;/h2&gt;

&lt;p&gt;Document&lt;br&gt;
│&lt;br&gt;
└── html&lt;br&gt;
    │&lt;br&gt;
    ├── h1&lt;br&gt;
    │   └── "Hello World"&lt;br&gt;
    │&lt;br&gt;
    └── button&lt;br&gt;
        └── "Click Me"&lt;/p&gt;

&lt;p&gt;JavaScript can access these elements through the DOM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need DOM?
&lt;/h2&gt;

&lt;p&gt;Without the DOM, JavaScript would not have an easy way to interact with the HTML page.&lt;/p&gt;

&lt;p&gt;We use the DOM to:&lt;/p&gt;

&lt;p&gt;*Change HTML content&lt;br&gt;
*Change CSS/styles&lt;br&gt;
*Change attributes&lt;br&gt;
*Add new elements&lt;br&gt;
*Remove elements&lt;br&gt;
*Handle button clicks&lt;br&gt;
*Handle user input&lt;br&gt;
*Create dynamic webpages&lt;br&gt;
*Respond to user actions&lt;/p&gt;

&lt;p&gt;For example, when you click a button and something changes on the webpage, JavaScript is usually interacting with the DOM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Methods of DOM in JavaScript
&lt;/h2&gt;

&lt;p&gt;DOM methods are functions provided by the browser to find, create, modify, and remove HTML elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Finding Elements
&lt;/h2&gt;

&lt;h2&gt;
  
  
  getElementById()
&lt;/h2&gt;

&lt;p&gt;Finds an element using its id.&lt;/p&gt;

&lt;p&gt;`let heading = document.getElementById("title");&lt;/p&gt;

&lt;p&gt;console.log(heading);&lt;br&gt;
`&lt;/p&gt;

&lt;h2&gt;
  
  
  getElementsByClassName()
&lt;/h2&gt;

&lt;p&gt;Finds elements using their class name.&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;
&lt;p&gt;Hello&lt;/p&gt;


&lt;p&gt;Welcome&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;`let elements = document.getElementsByClassName("text");&lt;/p&gt;

&lt;p&gt;console.log(elements);&lt;br&gt;
`&lt;/p&gt;

&lt;h2&gt;
  
  
  getElementsByTagName()
&lt;/h2&gt;

&lt;p&gt;Finds elements using their HTML tag.&lt;/p&gt;

&lt;p&gt;`let paragraphs = document.getElementsByTagName("p");&lt;/p&gt;

&lt;p&gt;console.log(paragraphs);`&lt;/p&gt;

&lt;h2&gt;
  
  
  querySelector()
&lt;/h2&gt;

&lt;p&gt;Finds the first matching element using a CSS selector.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let heading = document.querySelector("#title");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Class:&lt;/p&gt;

&lt;p&gt;`let element = document.querySelector(".text");&lt;/p&gt;

&lt;p&gt;`Tag:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let paragraph = document.querySelector("p");&lt;/code&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>OPERATORS IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Thu, 03 Sep 2026 16:08:01 +0000</pubDate>
      <link>https://dev.to/narmathachandra/operators-in-javascript-1b4</link>
      <guid>https://dev.to/narmathachandra/operators-in-javascript-1b4</guid>
      <description>&lt;h2&gt;
  
  
  OPERATORS IN JAVASCRIPT:
&lt;/h2&gt;

&lt;p&gt;Operators in JavaScript are special symbols or keywords used to perform operations on values and variables. They are used for calculations, assigning values, comparing values, and making logical decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  For example:
&lt;/h2&gt;

&lt;p&gt;`let a = 10;&lt;br&gt;
let b = 5;&lt;/p&gt;

&lt;p&gt;let result = a + b;&lt;br&gt;
console.log(result); // 15`&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Operators in JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript mainly provides the following types of operators:&lt;/p&gt;

&lt;p&gt;1.Arithmetic Operators&lt;br&gt;
2.Assignment Operators&lt;br&gt;
3.Comparison Operators&lt;br&gt;
4.Logical Operators&lt;br&gt;
5.Increment and Decrement Operators&lt;br&gt;
6.Ternary Operator&lt;br&gt;
7.String Operators&lt;br&gt;
8.Bitwise Operators&lt;br&gt;
9.Type Operators&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Arithmetic Operators
&lt;/h2&gt;

&lt;p&gt;Used to perform mathematical calculations.&lt;br&gt;
Operators: +, -, &lt;em&gt;, /, %, *&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;`let a = 10;&lt;br&gt;
let b = 5;&lt;/p&gt;

&lt;p&gt;console.log(a + b); // 15`&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Assignment Operators
&lt;/h2&gt;

&lt;p&gt;Used to assign values to variables.&lt;br&gt;
Operators: =, +=, -=, *=, /=, %=&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;`let a = 10;&lt;br&gt;
a += 5;&lt;/p&gt;

&lt;p&gt;console.log(a); // 15`&lt;/p&gt;

&lt;h2&gt;
  
  
  3.Comparison Operators
&lt;/h2&gt;

&lt;p&gt;Comparison operators compare two values and return a Boolean&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;console.log(10 &amp;gt; 5);  // true&lt;br&gt;
console.log(10 &amp;lt; 5);  // false&lt;br&gt;
console.log(10 &amp;gt;= 10); // true&lt;br&gt;
console.log(5 &amp;lt;= 10);  // true&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Logical Operators
&lt;/h2&gt;

&lt;p&gt;Used to combine multiple conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  AND &amp;amp;&amp;amp;
&lt;/h2&gt;

&lt;p&gt;Both conditions must be true.&lt;/p&gt;

&lt;p&gt;let age = 20;&lt;br&gt;
let hasID = true;&lt;/p&gt;

&lt;p&gt;console.log(age &amp;gt;= 18 &amp;amp;&amp;amp; hasID);&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;true&lt;/p&gt;

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

&lt;p&gt;let age = 20;&lt;/p&gt;

&lt;p&gt;if (age &amp;gt;= 18 &amp;amp;&amp;amp; age &amp;lt;= 60) {&lt;br&gt;
    console.log("Allowed");&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  OR ||
&lt;/h2&gt;

&lt;p&gt;At least one condition must be true.&lt;/p&gt;

&lt;p&gt;let isStudent = false;&lt;br&gt;
let isEmployee = true;&lt;/p&gt;

&lt;p&gt;console.log(isStudent || isEmployee); // true&lt;/p&gt;

&lt;h2&gt;
  
  
  NOT !
&lt;/h2&gt;

&lt;p&gt;Reverses a Boolean value.&lt;/p&gt;

&lt;p&gt;let loggedIn = true;&lt;/p&gt;

&lt;p&gt;console.log(!loggedIn); // false&lt;/p&gt;

&lt;h2&gt;
  
  
  5.String Operators
&lt;/h2&gt;

&lt;p&gt;The + operator can be used to join strings.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;`let firstName = "John";&lt;br&gt;
let lastName = "Doe";&lt;/p&gt;

&lt;p&gt;let fullName = firstName + " " + lastName;&lt;/p&gt;

&lt;p&gt;console.log(fullName);&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>CONDITION STATEMENT IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 01 Sep 2026 16:02:28 +0000</pubDate>
      <link>https://dev.to/narmathachandra/condition-statement-in-javascript-41d4</link>
      <guid>https://dev.to/narmathachandra/condition-statement-in-javascript-41d4</guid>
      <description>&lt;h2&gt;
  
  
  CONDITION STATEMENT IN JAVASCRIPT
&lt;/h2&gt;

&lt;p&gt;A conditional statement in JavaScript is a programming statement that is used to make decisions in a program based on whether a particular condition is true or false. It allows the program to control the flow of execution by checking a condition and then executing a specific block of code depending on the result of that condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  IF STATEMENT:
&lt;/h2&gt;

&lt;p&gt;The if statement is a conditional statement used to execute a block of code only when a specified condition is true.&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;if (condition) {&lt;br&gt;
    // code to execute if condition is true&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  EXAMPLE
&lt;/h2&gt;

&lt;p&gt;let age = 20;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if (age &amp;gt;= 18) {&lt;br&gt;
    console.log("You are an adult");&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  IF ELSE STATEMENT:
&lt;/h2&gt;

&lt;p&gt;The if...else statement in JavaScript is a conditional statement that is used to execute one block of code if a condition is true and another block of code if the condition is false.&lt;/p&gt;

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

&lt;p&gt;`if (condition) {&lt;br&gt;
    // code if condition is true&lt;br&gt;
} else {&lt;br&gt;
    // code if condition is false&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;h2&gt;
  
  
  EXAMPLE
&lt;/h2&gt;

&lt;p&gt;`let age = 16;&lt;/p&gt;

&lt;p&gt;if (age &amp;gt;= 18) {&lt;br&gt;
    console.log("You are an adult");&lt;br&gt;
} else {&lt;br&gt;
    console.log("You are a minor");&lt;br&gt;
}`&lt;/p&gt;

</description>
    </item>
    <item>
      <title>LOOP IN JAVASCRIPT</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Tue, 01 Sep 2026 15:47:43 +0000</pubDate>
      <link>https://dev.to/narmathachandra/loop-in-javascript-29pl</link>
      <guid>https://dev.to/narmathachandra/loop-in-javascript-29pl</guid>
      <description>&lt;h2&gt;
  
  
  For Loop in JavaScript
&lt;/h2&gt;

&lt;p&gt;A for loop in JavaScript is used to execute a block of code repeatedly as long as a given condition is true.&lt;/p&gt;

&lt;p&gt;Instead of writing the same code many times, we can use a loop to repeat it automatically.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for (initialization; condition; increment/decrement) {&lt;br&gt;
    // code to be executed&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  for loop has three important parts:
&lt;/h2&gt;

&lt;p&gt;1.Initialization – Runs only once at the beginning.&lt;br&gt;
2.Condition – Checked before every iteration. If it is true, the loop runs.&lt;br&gt;
3.Increment/Decrement – Changes the value after each iteration.&lt;/p&gt;

&lt;h2&gt;
  
  
  While loop in javascript
&lt;/h2&gt;

&lt;p&gt;A while loop is used when you want to repeatedly execute a block of code as long as a condition is true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check condition → Execute code → Update something → Check again
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Basic syntax
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  for example
&lt;/h2&gt;

&lt;p&gt;`let i = 1;&lt;/p&gt;

&lt;p&gt;while (i &amp;lt;= 5) {&lt;br&gt;
    console.log(i);&lt;br&gt;
    i++;&lt;br&gt;
}`&lt;/p&gt;

&lt;h2&gt;
  
  
  output
&lt;/h2&gt;

&lt;p&gt;1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
4&lt;br&gt;
5&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Primitive data types in javascript</title>
      <dc:creator>Narmatha</dc:creator>
      <pubDate>Wed, 26 Aug 2026 08:02:53 +0000</pubDate>
      <link>https://dev.to/narmathachandra/primitive-data-types-in-javascript-4c57</link>
      <guid>https://dev.to/narmathachandra/primitive-data-types-in-javascript-4c57</guid>
      <description>&lt;h2&gt;
  
  
  PRIMITIVE DATA TYPES IN JAVASCRIPT
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JavaScript has seven primitive data types: String, Number, BigInt, Boolean, Undefined, Null, and Symbol.Primitive types are the most basic building blocks of data in JavaScript.&lt;br&gt;
 They represent a single value and are immutable, meaning their internal values cannot be changed after creation.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  The 7 Primitive Data Types&lt;br&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. String :
&lt;/h2&gt;

&lt;p&gt;Represents textual data. Strings must be enclosed in single quotes ('), double quotes ("), or backticks (`).&lt;/p&gt;

&lt;h2&gt;
  
  
  javascript
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let name = "Alice";&lt;br&gt;
let greeting = 'Hello';&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Number :
&lt;/h2&gt;

&lt;p&gt;Represents both integers and floating-point (decimal) numbers. It also includes special values like NaN (Not a Number) an Infinity.&lt;/p&gt;

&lt;h2&gt;
  
  
  javascript
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let age = 25;&lt;br&gt;
let weight = 50.1;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. BigInt:
&lt;/h2&gt;

&lt;p&gt;Large integers beyond the safe calculation limit of the standard Number type (ends with an n, e.g., 9007199254740991n).&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Boolean:
&lt;/h2&gt;

&lt;p&gt;logical entity with only two possible values: true or false.&lt;/p&gt;

&lt;h2&gt;
  
  
  javascript
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let isCoding = true;&lt;br&gt;
let isTired = false;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5.undefined
&lt;/h2&gt;

&lt;p&gt;Automatically assigned to a variable that has been declared but not yet given a value.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let x console.log(x);&lt;/code&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  6. Null
&lt;/h2&gt;

&lt;p&gt;Represents an intentional absence of any object value. It is used to explicitly state that a variable is empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  javascript
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;let emptyValue = null;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
