<?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: vidhya murali</title>
    <description>The latest articles on DEV Community by vidhya murali (@vidhya_murali_5aabe7784bd).</description>
    <link>https://dev.to/vidhya_murali_5aabe7784bd</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%2F3924225%2Fe7e20af2-0747-45fc-aa5b-4858d0aacc25.png</url>
      <title>DEV Community: vidhya murali</title>
      <link>https://dev.to/vidhya_murali_5aabe7784bd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vidhya_murali_5aabe7784bd"/>
    <language>en</language>
    <item>
      <title>JavaScript Array Search</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Wed, 24 Jun 2026 17:31:44 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/javascript-array-search-25h3</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/javascript-array-search-25h3</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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzklbom23j642qc85wk2.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzklbom23j642qc85wk2.png" alt=" " width="722" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array indexOf()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The indexOf() method searches an array for an element value and returns its position.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Far9nfxrz9ftyz7ejvd1d.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Far9nfxrz9ftyz7ejvd1d.png" alt=" " width="621" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0b4z7z1y7g87pr8e63t9.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0b4z7z1y7g87pr8e63t9.png" alt=" " width="566" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb2mhgp8i5brzktpu55db.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb2mhgp8i5brzktpu55db.png" alt=" " width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array lastIndexOf()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Array.lastIndexOf() is the same as Array.indexOf(), but returns the position of the last occurrence of the specified element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4crnvd2y3ptfbuakcubo.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4crnvd2y3ptfbuakcubo.png" alt=" " width="619" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz63dl3dke8i9fpk572tz.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz63dl3dke8i9fpk572tz.png" alt=" " width="799" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array includes()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ECMAScript 2016 introduced Array.includes() to arrays. This allows us to check if an element is present in an array (including NaN, unlike indexOf).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1tquvbl51sfonau83waj.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1tquvbl51sfonau83waj.png" alt=" " width="650" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flaznrxgdh9de3jmb9dnu.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flaznrxgdh9de3jmb9dnu.png" alt=" " width="667" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array find()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The find() method returns the value of the first array element that passes a test function.&lt;/p&gt;

&lt;p&gt;This example finds (returns the value of) the first element that is larger than 18:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faipzbhut1g8en52oajtt.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faipzbhut1g8en52oajtt.png" alt=" " width="501" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the function takes 3 arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The item value&lt;/li&gt;
&lt;li&gt;The item index&lt;/li&gt;
&lt;li&gt;The array itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array findIndex()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The findIndex() method returns the index of the first array element that passes a test function.&lt;/p&gt;

&lt;p&gt;This example finds the index of the first element that is larger than 18:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1m0ltyg2z327ae75ftme.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1m0ltyg2z327ae75ftme.png" alt=" " width="496" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the function takes 3 arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The item value&lt;/li&gt;
&lt;li&gt;The item index&lt;/li&gt;
&lt;li&gt;The array itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array findLast() Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES2023 added the findLast() method that will start from the end of an array and return the value of the first element that satisfies a condition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw4rfddd7ak5f4m0e76sg.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw4rfddd7ak5f4m0e76sg.png" alt=" " width="543" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array findLastIndex() Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The findLastIndex() method finds the index of the last element that satisfies a condition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxd8mprko7w4gkpyu0xvq.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxd8mprko7w4gkpyu0xvq.png" alt=" " width="541" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Array Methods in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Wed, 24 Jun 2026 17:18:46 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/array-methods-in-javascript-4eke</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/array-methods-in-javascript-4eke</guid>
      <description>&lt;p&gt;&lt;strong&gt;JavaScript Array Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkrb6awys2vt8l57gf0gh.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkrb6awys2vt8l57gf0gh.png" alt=" " width="672" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array length&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The length property returns the length (size) of an array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fadtb11mprquq5eu9bfq3.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fadtb11mprquq5eu9bfq3.png" alt=" " width="683" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The length property can also be used to set the length of an array:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     const fruits = ["Banana", "Orange", "Apple", "Mango"];

     fruits.length = 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array toString()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The toString() method returns the elements of an array as a comma separated string.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   const fruits = ["Banana", "Orange", "Apple", "Mango"];

   let myList = fruits.toString();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Every JavaScript object has a toString() method.&lt;/p&gt;

&lt;p&gt;The toString() method is used internally by JavaScript when an object needs to be displayed as a text (like in HTML), or when an object needs to be used as a string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array at()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES2022 introduced the array method at()&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; const fruits = ["Banana", "Orange", "Apple", "Mango"];
 let fruit = fruits.at(2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;(or)&lt;br&gt;
       let fruit = fruits[2];&lt;/p&gt;

&lt;p&gt;The at() method returns an indexed element from an array.&lt;/p&gt;

&lt;p&gt;The at() method returns the same as []&lt;/p&gt;

&lt;p&gt;at() is an ECMAScript 2022 feature.&lt;/p&gt;

&lt;p&gt;JavaScript 2022 is supported in all modern browsers since March 2022&lt;/p&gt;

&lt;p&gt;Many languages allow negative bracket indexing like [-1] to access elements from the end of an object / array / string.&lt;/p&gt;

&lt;p&gt;This is not possible in JavaScript, because [] is used for accessing both arrays and objects. obj[-1] refers to the value of key -1, not to the last property of the object.&lt;/p&gt;

&lt;p&gt;The at() method was introduced in ES2022 to solve this problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array join()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The join() method also joins all array elements into a string.&lt;/p&gt;

&lt;p&gt;It behaves just like toString(), but in addition you can specify the separator:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyinb8y9w2v8zdbaxhnwy.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyinb8y9w2v8zdbaxhnwy.png" alt=" " width="631" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popping and Pushing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you work with arrays, it is easy to remove elements and add new elements.&lt;/p&gt;

&lt;p&gt;This is what popping and pushing is:&lt;/p&gt;

&lt;p&gt;Popping items out of an array, or pushing items into an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array pop()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The pop() method removes the last element from an array:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; const fruits = ["Banana", "Orange", "Apple", "Mango"];
 fruits.pop();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The pop() method returns the value that was "popped out":&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   const fruits = ["Banana", "Orange", "Apple", "Mango"];
   let fruit = fruits.pop();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array push()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The push() method adds a new element to an array (at the end):&lt;/p&gt;

&lt;p&gt;const fruits = ["Banana", "Orange", "Apple", "Mango"];&lt;br&gt;
  fruits.push("Kiwi");&lt;/p&gt;

&lt;p&gt;The push() method returns the new array length:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fruits = ["Banana", "Orange", "Apple", "Mango"];
let length = fruits.push("Kiwi");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Shifting Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shifting is equivalent to popping, but working on the first element instead of the last.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array shift()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The shift() method removes the first array element and "shifts" all other elements to a lower index.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwbxuphy171q28ugyntu2.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwbxuphy171q28ugyntu2.png" alt=" " width="569" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The shift() method returns the value that was "shifted out".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array unshift()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The unshift() method adds a new element to an array (at the beginning), and "unshifts" older elements:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnu2hx915wctec7sorhdc.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnu2hx915wctec7sorhdc.png" alt=" " width="575" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The unshift() method returns the new array length:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changing Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Array elements are accessed using their index number&lt;/p&gt;

&lt;p&gt;Array indexes start with 0:&lt;/p&gt;

&lt;p&gt;[0] is the first array element&lt;br&gt;
[1] is the second&lt;br&gt;
[2] is the third ..&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array length&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The length property provides an easy way to append a new element to an array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fylbwm4byzr0tqs42qmpi.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fylbwm4byzr0tqs42qmpi.png" alt=" " width="597" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array.isArray()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ECMAScript 5 (JavaScript 2009) added the new method Array.isArray() to JavaScript:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      Array.isArray(fruits);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array delete()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Warning !&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Using delete() leaves undefined holes in the array.&lt;/p&gt;

&lt;p&gt;Use pop() or shift() instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7o453all193rvg1fmyuf.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7o453all193rvg1fmyuf.png" alt=" " width="585" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merging Arrays (Concatenating)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In programming languages, concatenation means joining strings end-to-end.&lt;/p&gt;

&lt;p&gt;Concatenation "snow" and "ball" gives "snowball".&lt;/p&gt;

&lt;p&gt;Concatenating arrays means joining arrays end-to-end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array concat(&lt;/strong&gt;)&lt;/p&gt;

&lt;p&gt;The concat() method creates a new array by merging (concatenating) existing arrays:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6foh3ke66t0fj15db83a.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6foh3ke66t0fj15db83a.png" alt=" " width="513" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concat() method does not change the existing arrays. It always returns a new array.&lt;/p&gt;

&lt;p&gt;The concat() method can take any number of array arguments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0f45tc6r3h4bh2wwz7a.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0f45tc6r3h4bh2wwz7a.png" alt=" " width="498" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flhang4ql5q9nf28srlfp.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flhang4ql5q9nf28srlfp.png" alt=" " width="319" height="39"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concat() method can also take strings as arguments:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array copyWithin()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The copyWithin() method copies array elements to another position in an array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fihb41fbohx4bjw0qzkr7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fihb41fbohx4bjw0qzkr7.png" alt=" " width="601" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbdenpskeujkj1w1y81rx.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbdenpskeujkj1w1y81rx.png" alt=" " width="671" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7lpl941lmhj6wbvm7jrf.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7lpl941lmhj6wbvm7jrf.png" alt=" " width="687" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flattening an Array&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Flattening an array is the process of reducing the dimensionality of an array.&lt;/p&gt;

&lt;p&gt;Flattening is useful when you want to convert a multi-dimensional array into a one-dimensional array&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array flat()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES2019 Introduced the Array flat() method.&lt;/p&gt;

&lt;p&gt;The flat() method creates a new array with sub-array elements concatenated to a specified depth&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimb98vyx4akdg32zocmt.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimb98vyx4akdg32zocmt.png" alt=" " width="619" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array flatMap()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES2019 added the Array flatMap() method to JavaScript.&lt;/p&gt;

&lt;p&gt;The flatMap() method first maps all elements of an array and then creates a new array by flattening the array.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9jz91qhl2w7aslc43w0q.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9jz91qhl2w7aslc43w0q.png" alt=" " width="448" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Splicing and Slicing Arrays&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The splice() method adds new items to an array.&lt;/p&gt;

&lt;p&gt;The slice() method slices out a piece of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array splice()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The splice() method can be used to add new items to an array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F60hlwqe4y7g28htaas0x.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F60hlwqe4y7g28htaas0x.png" alt=" " width="577" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first parameter (2) defines the position where new elements should be added (spliced in).&lt;/p&gt;

&lt;p&gt;The second parameter (0) defines how many elements should be removed.&lt;/p&gt;

&lt;p&gt;The rest of the parameters ("Lemon" , "Kiwi") define the new elements to be added.&lt;/p&gt;

&lt;p&gt;The splice() method returns an array with the deleted items:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using splice() to Remove Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With clever parameter setting, you can use splice() to remove elements without leaving "holes" in the array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frjvz6xejann2otgj3bhk.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frjvz6xejann2otgj3bhk.png" alt=" " width="606" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first parameter (0) defines the position where new elements should be added (spliced in).&lt;/p&gt;

&lt;p&gt;The second parameter (1) defines how many elements should be removed.&lt;/p&gt;

&lt;p&gt;The rest of the parameters are omitted. No new elements will be added.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array toSpliced()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES2023 added the Array toSpliced() method as a safe way to splice an array without altering the original array.&lt;/p&gt;

&lt;p&gt;The difference between the new toSpliced() method and the old splice() method is that the new method creates a new array, keeping the original array unchanged, while the old method altered the original array&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqdctc6xq2r7c3smdyvk0.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqdctc6xq2r7c3smdyvk0.png" alt=" " width="601" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Array slice()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The slice() method slices out a piece of an array into a new array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdb81q4t8vaztc8rfk5c8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdb81q4t8vaztc8rfk5c8.png" alt=" " width="613" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyo109tiza4kq96oqixxm.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyo109tiza4kq96oqixxm.png" alt=" " width="677" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6m9l1ibsqqgcd0abh8bl.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6m9l1ibsqqgcd0abh8bl.png" alt=" " width="628" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The slice() method can take two arguments like slice(1, 3).&lt;/p&gt;

&lt;p&gt;The method then selects elements from the start argument, and up to (but not including) the end argument&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const fruits = ["Banana", "Orange", "Lemon", "Apple", "Mango"];
  const citrus = fruits.slice(1, 3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Array in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Wed, 24 Jun 2026 16:26:24 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/array-in-javascript-254m</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/array-in-javascript-254m</guid>
      <description>&lt;p&gt;An Array is an object type designed for storing data collections.&lt;/p&gt;

&lt;p&gt;Key characteristics of JavaScript arrays are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Elements: An array is a list of values, known as elements.&lt;/li&gt;
&lt;li&gt;Ordered: Array elements are ordered based on their index.&lt;/li&gt;
&lt;li&gt;Zero indexed: The first element is at index 0, the second at index 1, and so on.&lt;/li&gt;
&lt;li&gt;Dynamic size: Arrays can grow or shrink as elements are added or removed.&lt;/li&gt;
&lt;li&gt;Heterogeneous: Arrays can store elements of different data types (numbers, strings, objects and other arrays).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Use Arrays?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have a list of items (a list of car names, for example), storing the names in single variables could look like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           let car1 = "Saab";
           let car2 = "Volvo";
           let car3 = "BMW";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars, but 300?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution is an array!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An array can hold many values under a single name, and you can access the values by referring to an index number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating an Array&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using an array literal is the easiest way to create a JavaScript Array.&lt;/p&gt;

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

&lt;p&gt;const array_name = [item1, item2, ...];&lt;/p&gt;

&lt;p&gt;It is a common practice to declare arrays with the const keyword.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3580954ajvqu6wymddu7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3580954ajvqu6wymddu7.png" alt=" " width="428" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also create an empty array, and provide elements later:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fngd4poxsldwrlct8xurk.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fngd4poxsldwrlct8xurk.png" alt=" " width="413" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the JavaScript Keyword new&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following example also creates an Array, and assigns values to it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa4asqhwaactw073jnd5h.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa4asqhwaactw073jnd5h.png" alt=" " width="617" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The two examples above do exactly the same.&lt;/p&gt;

&lt;p&gt;There is no need to use new Array().&lt;/p&gt;

&lt;p&gt;For simplicity, readability and execution speed, use the array literal method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Array Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You access an array element by referring to the index number:&lt;/p&gt;

&lt;p&gt;const cars = ["Saab", "Volvo", "BMW"];&lt;br&gt;
let car = cars[0];&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changing an Array Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This statement changes the value of the first element in cars:&lt;/p&gt;

&lt;p&gt;const cars = ["Saab", "Volvo", "BMW"];&lt;br&gt;
cars[0] = "Opel";&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
    <item>
      <title>Objects in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Tue, 16 Jun 2026 08:08:28 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/objects-in-javascript-5600</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/objects-in-javascript-5600</guid>
      <description>&lt;p&gt;An object is a dynamic data structure that stores related data as key-value pairs, where each key uniquely identifies its value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9hi9cwh3yxca6o8io1i8.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%2F9hi9cwh3yxca6o8io1i8.png" alt=" " width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The values of properties can be primitives, objects, or functions (known as methods when defined inside an object).&lt;/li&gt;
&lt;li&gt;Objects are mutable and dynamic properties can be added, modified, or deleted at any time.&lt;/li&gt;
&lt;li&gt;Objects allow data grouping and encapsulation, making it easier to manage related information and behaviour together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Object Literal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An object literal "literally" describes an object using a concise syntax with zero or more key:value pairs inside curly braces to describe all the object properties:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  {  firstName:"John",
     lastName:"Doe", 
     age:50,
     eyeColor:"blue"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Note : You should declare objects with the const keyword.&lt;/p&gt;

&lt;p&gt;There are two primary ways to create an object in JavaScript:&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;Creation Using Object Literal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The object literal syntax allows you to define and initialize an object with curly braces {}, setting properties as key-value pairs.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      let obj = {
         name: "vidhya",
         age: 23,
         job: "Developer"
      };
     console.log(obj);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;2.&lt;strong&gt;Creation Using new Object() Constructor&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     let obj = new Object();
     obj.name= "Alex",
     obj.age= 4,
     obj.job= "WatchMan"

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

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Basic Operations on JavaScript Objects&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accessing Object Properties&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can access an object’s properties using either dot notation or bracket notation&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // Using Dot Notation
     console.log(obj.name);

    // Using Bracket Notation
     console.log(obj["age"]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Modifying Object Properties&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Properties in an object can be modified by reassigning their values.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let obj = { name: "vidhya", age: 23 };
 console.log(obj);

 obj.age = 25;
 console.log(obj);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Adding Properties to an Object&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can dynamically add new properties to an object using dot or bracket notation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2o2rzpdq7fdqk64e9ka.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%2Fs2o2rzpdq7fdqk64e9ka.png" alt=" " width="582" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Removing Properties from an Object&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The delete operator removes properties from an object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fll3yumjla3qk05i239b4.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%2Fll3yumjla3qk05i239b4.png" alt=" " width="559" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checking if a Property Exists&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can check if an object has a property using the in operator or hasOwnProperty() method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmafmo2pok0nz37uhhrwn.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%2Fmafmo2pok0nz37uhhrwn.png" alt=" " width="570" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Iterating Through Object Properties&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use for...in loop to iterate through the properties of an object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Froxhx584lqkd577uoyby.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%2Froxhx584lqkd577uoyby.png" alt=" " width="538" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Merging Objects&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Objects can be merged using Object.assign() or the spread syntax { ...obj1, ...obj2 }.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bq58uaj3xz1wpwk286f.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%2F1bq58uaj3xz1wpwk286f.png" alt=" " width="586" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Object Length&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can find the number of properties in an object using Object.keys().&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4rh6m3sc5k4hpovza33t.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%2F4rh6m3sc5k4hpovza33t.png" alt=" " width="482" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference  :&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.geeksforgeeks.org/javascript/objects-in-javascript/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_200x200-min.png" height="200" class="m-0" width="200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.geeksforgeeks.org/javascript/objects-in-javascript/" rel="noopener noreferrer" class="c-link"&gt;
            Objects in JavaScript - GeeksforGeeks
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_favicon.png" width="32" height="32"&gt;
          geeksforgeeks.org
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.w3schools.com/js/js_object_intro.asp" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;w3schools.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Synchronous and Asynchronous in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Mon, 15 Jun 2026 07:05:25 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/synchronous-and-asynchronous-in-javascript-14ip</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/synchronous-and-asynchronous-in-javascript-14ip</guid>
      <description>&lt;p&gt;JavaScript is a single threaded programming language used for web development. It supports synchronous and asynchronous execution. In synchronous execution, statements run one after another, and each task waits for the previous one to finish. In asynchronous execution, some tasks run in the background without stopping the execution of other code.&lt;/p&gt;

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

&lt;p&gt;Synchronous programming executes code in sequence, where each statement waits for the previous one to complete before running. This makes the flow simple and predictable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xxr9jpdpfvhtbyizdkw.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%2F0xxr9jpdpfvhtbyizdkw.png" alt=" " width="430" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above code, “Hi” is logged first, then “Geek”, and finally “How are you”. Each statement executes only after the previous one completes.&lt;/p&gt;

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

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

&lt;p&gt;&lt;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%2Fa8nu1l983kb0eoffrs0n.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%2Fa8nu1l983kb0eoffrs0n.png" alt=" " width="606" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Call Stack&lt;/strong&gt;: Functions are executed in the order they are called. Each function is added to the stack and completed before the next one runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web APIs&lt;/strong&gt;: Functions like setTimeout, HTTP requests, and event listeners are handled by browser Web APIs without blocking the call stack.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Callback Queue&lt;/strong&gt;: After a Web API completes its task, the callback function is moved to the callback queue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Loop&lt;/strong&gt;: The event loop checks the call stack continuously. If it is empty, it moves functions from the callback queue to the stack for execution.&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%2Fxfjfzntzf9ek3s4i48ve.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%2Fxfjfzntzf9ek3s4i48ve.png" alt=" " width="618" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;&lt;strong&gt;Difference between Synchronous and Asynchronous JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuycid5zoly2sm69aaot1.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%2Fuycid5zoly2sm69aaot1.png" alt=" " width="712" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process vs Thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern operating systems are designed to handle multiple tasks efficiently while maintaining good performance and responsiveness. These are mainly achieved through processes and threads.&lt;/p&gt;

&lt;p&gt;Process is the Independent program with its own memory&lt;br&gt;
Thread is small unit of a process sharing same memory&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Process is a program that is currently in execution within an operating system. It operates in an independent environment and is managed by the OS for proper scheduling and execution. Processes form the basis of program execution in a multitasking system. Its Properties are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each process has a unique Process ID (PID) for identification.&lt;/li&gt;
&lt;li&gt;Every process moves through different states such as new, ready, running, waiting, and terminated.&lt;/li&gt;
&lt;li&gt;Processes communicate with each other using Inter-Process Communication (IPC) methods.&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%2F2008pxy51c2mmknskln5.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%2F2008pxy51c2mmknskln5.png" alt=" " width="354" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thread is a smallest unit of execution within a process. It enables a program to perform multiple tasks concurrently while sharing the same memory and resources. Threads improve application performance and responsiveness in multitasking environments. Its properties are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each thread has its own Thread ID (TID) for identification.&lt;/li&gt;
&lt;li&gt;A thread also moves through states such as new, runnable, running, waiting, and terminated.&lt;/li&gt;
&lt;li&gt;Threads within the same process share memory and resources, enabling faster communication.&lt;/li&gt;
&lt;li&gt;Context switching can occur between threads to allow multiple tasks to execute efficiently.&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%2F1kvkt7w2ymnecklxnhw3.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%2F1kvkt7w2ymnecklxnhw3.png" alt=" " width="321" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Similarities Between Threads and Processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Units of Execution&lt;/strong&gt;: Both are execution units within an operating system and are part of process management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OS Scheduling &amp;amp; Preemption&lt;/strong&gt;: Both are scheduled by the operating system for fair CPU allocation, and can be preempted for multitasking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Own Execution Context&lt;/strong&gt;: Each has its own execution context, including program counter, CPU registers, and stack space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creation During Runtime&lt;/strong&gt;: Both can create child entities during their execution lifecycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Communication &amp;amp; Resource Release&lt;/strong&gt;: Both can communicate using IPC mechanisms, and upon termination, their allocated resources are released back to the operating system&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process vs Thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxdlmdvuj43k4n95ki7k.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%2Ffxdlmdvuj43k4n95ki7k.png" alt=" " width="718" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>ai</category>
    </item>
    <item>
      <title>Type of Functions in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Mon, 15 Jun 2026 06:27:22 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/type-of-functions-in-javascript-44a</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/type-of-functions-in-javascript-44a</guid>
      <description>&lt;p&gt;Here are all the main types of functions in JavaScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Named Function&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A function that has its own name when declared. It’s easy to reuse and debug because the name shows up in error messages or stack traces.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  function greet() {
     return "Hello!";
  }
  console.log(greet());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2.Anonymous Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function that does not have a name. It is usually assigned to a variable or used as a callback. Since it has no name, it cannot be called directly.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const greet = function() {
        return "Hi there!";
    };
    console.log(greet());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;When you assign a function (can be named or anonymous) to a variable. The function can then be used by calling that variable.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const add = function(a, b) {
     return a + b;
   };
  console.log(add(2, 3));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;4.&lt;strong&gt;Arrow Function (ES6)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A new way to write functions using the =&amp;gt; syntax. They are shorter and do not have their own this binding, which makes them useful in some cases.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const square = n =&amp;gt; n * n;
    console.log(square(4));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Immediately Invoked Function Expression (IIFE)&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;IIFE functions are executed immediately after their definition. They are often used to create isolated scopes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; (function () {
    console.log("This runs immediately!");
  })();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;6. Callback Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A callback function is passed as an argument to another function and is executed after the completion of that function.&lt;/p&gt;

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

   const double = (n) =&amp;gt; n * 2;

   console.log(num(5, double));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Constructor Function&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A special type of function used to create multiple objects with the same structure. It’s called with the new keyword&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    function Person(name, age) {
      this.name = name;
      this.age = age;
    }

    const user = new Person("Neha", 22);
    console.log(user.name);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;8.&lt;strong&gt;Async Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions that handle asynchronous tasks. Declared with async, they return a Promise, and you can use await inside them to pause until another Promise resolves.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  async function fetchData() {
   return "Data fetched!";
   }
   fetchData().then(console.log);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;9.&lt;strong&gt;Generator Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Declared with an asterisk *, these functions can pause execution using yield and resume later. Useful for lazy loading values or handling iterators.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymvsph3ly8cyx4dv70nd.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%2Fymvsph3ly8cyx4dv70nd.png" alt=" " width="581" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;10.&lt;strong&gt;Recursive Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function that calls itself until a condition is met. Very useful for problems like factorial, Fibonacci, or tree traversals.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdy6zibwghw85fe7lwd9.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%2Ffdy6zibwghw85fe7lwd9.png" alt=" " width="541" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;11.&lt;strong&gt;Higher-Order Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function that either takes another function as a parameter or returns another function. These are common in JavaScript (e.g., map, filter, reduce).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhjb959f3drck0ix7zpo.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%2Fnhjb959f3drck0ix7zpo.png" alt=" " width="557" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;12.&lt;strong&gt;Nested Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions defined within other functions are called nested functions. They have access to the variables of their parent function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4o8aucteby7tkfsi8l4c.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%2F4o8aucteby7tkfsi8l4c.png" alt=" " width="612" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;13.&lt;strong&gt;Pure Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pure functions return the same output for the same inputs and do not produce side effects. They do not modify state outside their scope, such as modifying global variables, changing the state of objects passed as arguments, or performing I/O operations&lt;/p&gt;

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

    console.log(pureAdd(2, 3));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;14.** Rest Parameter Function**&lt;/p&gt;

&lt;p&gt;Uses ... to collect all remaining arguments into an array. Very useful when you don’t know how many arguments will be passed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg3szweo28hje7o3huux1.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%2Fg3szweo28hje7o3huux1.png" alt=" " width="534" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference : &lt;a href="https://www.geeksforgeeks.org/javascript/functions-in-javascript/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/javascript/functions-in-javascript/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>functionsinjavascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Functions in JavaScript</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Mon, 15 Jun 2026 05:57:40 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascript-38h8</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascript-38h8</guid>
      <description>&lt;p&gt;&lt;strong&gt;JavaScript Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions are Code Blocks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functions are reusable code blocks designed to perform a particular task.&lt;/li&gt;
&lt;li&gt;Functions are executed when they are called or invoked.&lt;/li&gt;
&lt;li&gt;Functions are fundamental in all programming languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They allow you to organize, reuse, and modularize code. It can take inputs, perform actions, and return outputs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvz45rac3n2k0hvg8ac5v.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%2Fvz45rac3n2k0hvg8ac5v.png" alt=" " width="692" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions help you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse code (write once, run many times)&lt;/li&gt;
&lt;li&gt;Organize code into smaller parts&lt;/li&gt;
&lt;li&gt;Make code easier to read and maintain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What Does a Function Look Like?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function can be created with the function keyword, a name, and parentheses.&lt;/p&gt;

&lt;p&gt;The code to run is written inside curly brackets&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8e0xjq7jp0kwootxtq2.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%2Fx8e0xjq7jp0kwootxtq2.png" alt=" " width="735" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The function above does not do anything.It has to be called first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions Run When You Call Them&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To run a function, you call it by using its name followed by parentheses like sayHello().&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feb2sm6nwsmr1xqgo51f1.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%2Feb2sm6nwsmr1xqgo51f1.png" alt=" " width="681" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:() means execute now.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Function Syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;function name( p1, p2, ... ) {&lt;br&gt;
  // code to be executed&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Functions are defined with the function keyword:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;followed by the function name&lt;/li&gt;
&lt;li&gt;followed by parentheses ( )&lt;/li&gt;
&lt;li&gt;followed by brackets { }&lt;/li&gt;
&lt;li&gt;The function name follows the naming rules for variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optional parameters are listed inside parentheses: ( p1, p2, ... )&lt;/p&gt;

&lt;p&gt;Code to be executed is listed inside curly brackets: { }&lt;/p&gt;

&lt;p&gt;Functions can return an optional value back to the caller.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43i3q8e7o8n82h1sncqv.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%2F43i3q8e7o8n82h1sncqv.png" alt=" " width="567" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function definition is not an executable statement.&lt;/li&gt;
&lt;li&gt;It is not common to end a function definition with a semicolon.&lt;/li&gt;
&lt;li&gt;Semicolons are used to separate executable JavaScript statements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A Function Can Be Used Many Times&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A big benefit is that you can call the same function whenever you need it.&lt;/p&gt;

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

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

    let sum1 = add(5, 5);
    let sum2 = add(50, 50);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note : values returned from functions can be stored in variables&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables declared within a JavaScript function, become LOCAL to the function.&lt;/p&gt;

&lt;p&gt;Local variables can only be accessed from within the function.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // code here can NOT use carName
      function myFunction() {
         let carName = "Volvo";
    // code here CAN use carName
   }

// code here can NOT use carName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Since local variables are only recognized inside their functions, variables with the same name can be used in different functions&lt;/p&gt;

&lt;p&gt;Local variables are created when a function starts, and deleted when the function is completed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Input and Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most useful functions work like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters - some values are sent to the function&lt;/li&gt;
&lt;li&gt;Arguments - some values are received by the function&lt;/li&gt;
&lt;li&gt;Function Code - some work is done inside the function&lt;/li&gt;
&lt;li&gt;Return Output - some value is returned from the function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference :&lt;a href="https://www.w3schools.com/js/js_function_intro.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/js_function_intro.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>ai</category>
    </item>
    <item>
      <title>My First KanchiLUG Weekly Discussion Experience: An Introduction to Linux and Open Source</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Sun, 14 Jun 2026 13:14:39 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/my-first-kanchilug-weekly-discussion-experience-an-introduction-to-linux-and-open-source-21c5</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/my-first-kanchilug-weekly-discussion-experience-an-introduction-to-linux-and-open-source-21c5</guid>
      <description>&lt;p&gt;Today, I attended my first KanchiLUG (Kanchipuram Linux Users Group) meetup, and it was a memorable experience. As someone who is currently learning programming and exploring the world of technology, I was excited to attend the session and learn more about Linux and open source.&lt;/p&gt;

&lt;p&gt;What made the experience even more special was that the entire meetup was conducted in Tamil. Being able to learn technical concepts in my native language made the discussions much easier to understand and more engaging.&lt;/p&gt;

&lt;p&gt;Everyone was friendly, approachable, and willing to help. There was no hesitation in answering questions, and the environment encouraged learning and participation. As a beginner, this gave me the confidence to listen, learn, and interact with others.&lt;/p&gt;

&lt;p&gt;Before attending the session, I knew Linux mainly as an operating system. During the discussion, I learned much more about its importance in the technology world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Discovering Free Tamil Learning Resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of my favorite parts of the meetup was learning about free Tamil ebooks and educational resources.&lt;/p&gt;

&lt;p&gt;The community shared information about resources available in Tamil for:&lt;/p&gt;

&lt;p&gt;Linux&lt;br&gt;
Git and Version Control&lt;br&gt;
Programming Languages&lt;br&gt;
Computer Science Concepts&lt;/p&gt;

&lt;p&gt;As a Tamil speaker, this was exciting to discover. Many beginners struggle because most technical content is available only in English. Knowing that quality learning resources exist in Tamil makes technology more accessible and helps people learn concepts more comfortably.&lt;/p&gt;

&lt;p&gt;I believe these resources can encourage more students and beginners to start their learning journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Community Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One important lesson I learned from this meetup is that learning technology doesn't have to be a solo journey.&lt;/p&gt;

&lt;p&gt;Being part of a community allows us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn from experienced people&lt;/li&gt;
&lt;li&gt;Get guidance when we are stuck&lt;/li&gt;
&lt;li&gt;Discover useful resources&lt;/li&gt;
&lt;li&gt;Stay motivated&lt;/li&gt;
&lt;li&gt;Connect with like-minded learners&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The KanchiLUG community demonstrated how powerful knowledge sharing can be.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After attending my first KanchiLUG meetup, here are my biggest takeaways:&lt;/p&gt;

&lt;p&gt;Linux is a valuable technology worth learning.&lt;br&gt;
Open source is built on collaboration and community.&lt;br&gt;
There are excellent free learning resources available in Tamil.&lt;br&gt;
Tech communities can significantly accelerate learning.&lt;br&gt;
Asking questions and engaging with others helps us grow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Looking Forward&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attending this meetup motivated me to explore Linux, Git, and open-source technologies in greater depth. It also inspired me to become more involved in tech communities and continue learning from experienced members.&lt;/li&gt;
&lt;li&gt;I am grateful to the KanchiLUG organizers and community members for creating such a welcoming environment and making the session accessible in Tamil.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was my first KanchiLUG meetup, but definitely not my last. I look forward to attending future sessions, learning new things, and continuing my journey in the world of Linux and open source.&lt;/p&gt;

&lt;p&gt;Thank you, &lt;strong&gt;KanchiLUG&lt;/strong&gt;, for a wonderful first experience!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kanchilug.wordpress.com/" rel="noopener noreferrer"&gt;https://kanchilug.wordpress.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>linuxcommunity</category>
      <category>meetup</category>
      <category>kanchilugweeklydiscussion</category>
    </item>
    <item>
      <title>JavaScript Loops</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Wed, 10 Jun 2026 14:24:48 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/javascript-loops-43b3</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/javascript-loops-43b3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Loops in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Loops can execute a block of code a number of times&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript For Loop&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Loops can execute a block of code a number of times.&lt;/li&gt;
&lt;li&gt;For Loops are fundamental for tasks like performing an action multiple times.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The for statement creates a loop with 3 optional expressions:&lt;/p&gt;

&lt;p&gt;for (exp 1; exp 2; exp 3) {&lt;br&gt;
  // code block to be executed&lt;br&gt;
}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;exp 1 is executed (one time) before the execution of the code block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 2 defines the condition for executing the code block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 3 is executed (every time) after the code block has been executed.&lt;/p&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%2Fpr8mpjlpq334bj4qa2bc.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%2Fpr8mpjlpq334bj4qa2bc.png" alt=" " width="627" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the example above, you can read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exp 1 sets a variable before the loop starts (let i      = 0).&lt;/li&gt;
&lt;li&gt;exp 2 defines the condition for the loop to run (i must be less than 5).&lt;/li&gt;
&lt;li&gt;exp 3 increases a value (i++) after the code block has been executed.&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%2F79yeoimcht7lyj644yf6.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%2F79yeoimcht7lyj644yf6.png" alt=" " width="665" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use exp 1&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;exp 1 is used to initialize the variable(s) used in the loop (let i = 0).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 1 is optional.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can omit exp 1 if the value is set before the loop starts&lt;/p&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%2Fej81t6eb4ur65g2phb20.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%2Fej81t6eb4ur65g2phb20.png" alt=" " width="706" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use exp 2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;exp 2 is used to evaluate the condition of the initial variable (i &amp;lt; len).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 2 is also optional.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If exp 2 returns false, the loop will end.&lt;/p&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%2Fel8yvlvsjbpovmoeo17d.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%2Fel8yvlvsjbpovmoeo17d.png" alt=" " width="722" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use exp 3&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;exp 3 increments the value of the initial variable (i++).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 3 is optional.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exp 3 can do anything like negative increment (i--), positive increment (i = i + 15), or anything else.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;exp 3 can be omitted (if you increment the value inside the loop):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjkpuh0l9jgfd0qwkpgqy.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%2Fjkpuh0l9jgfd0qwkpgqy.png" alt=" " width="730" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Loop Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using var in a loop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5emno7696s6htyqjl7py.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%2F5emno7696s6htyqjl7py.png" alt=" " width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using let in a loop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjqk5l74up1xp6gbqd6k.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%2Ffjqk5l74up1xp6gbqd6k.png" alt=" " width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the first example, using var, the variable declared in the loop redeclares the variable outside the loop.&lt;/p&gt;

&lt;p&gt;In the second example, using let, the variable declared in the loop does not redeclare the variable outside the loop.&lt;/p&gt;

&lt;p&gt;When let is used to declare the i variable in a loop, the i variable will only be visible within the loop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript While Loops&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While loops execute a block of code as long as a specified condition is true.&lt;/p&gt;

&lt;p&gt;JavaScript have two types of while loops:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The while loop&lt;/li&gt;
&lt;li&gt;The do while loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The While Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The while loop loops through a block of code as long as a specified condition is true.&lt;/p&gt;

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

&lt;p&gt;while (condition) {&lt;br&gt;
  // code block to be executed&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr9kbexgp9z1t3euj74ar.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%2Fr9kbexgp9z1t3euj74ar.png" alt=" " width="721" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Do While Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The do while loop is a variant of the while loop. This loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfz9vvvc0qpzb0eab434.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%2Fwfz9vvvc0qpzb0eab434.png" alt=" " width="614" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The do while runs at least once, even if the condition is false from the start.This is because the code block is executed before the condition is tested.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzwqhruj23noi74ismw9e.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%2Fzwqhruj23noi74ismw9e.png" alt=" " width="719" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparing For and While&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A while loop is much the same as a for loop, with statement 1 and statement 3 omitted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdc80fl33ig92ijltecf.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%2Fpdc80fl33ig92ijltecf.png" alt=" " width="685" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jtitk3exe1w5zb53v5e.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%2F9jtitk3exe1w5zb53v5e.png" alt=" " width="734" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you forget to increase the variable used in the condition, the loop will never end.&lt;/li&gt;
&lt;li&gt;This will crash your browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference :&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.w3schools.com/js/js_loop_while.asp" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;w3schools.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>loops</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Frontend Developer - Mock Interview 1</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Mon, 08 Jun 2026 14:49:27 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/frontend-developer-mock-interview-1-52j</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/frontend-developer-mock-interview-1-52j</guid>
      <description>&lt;p&gt;&lt;strong&gt;Frontend Developer Mock Interview Questions with  Answers&lt;/strong&gt; [HTML, CSS , JavaScript]&lt;/p&gt;

&lt;p&gt;Today, I attended a mock interview for a Front-End Developer role. The interview mainly focused on HTML, CSS, and JavaScript. Below are some of the questions that were asked&lt;/p&gt;

&lt;p&gt;1,&lt;strong&gt;What are Semantic Tags ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Semantic tags are HTML tags that clearly describe the meaning and purpose of the content they contain. They make the structure of a web page easier for developers, browsers, and search engines to understand.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; – Defines the header section of a page.&lt;/li&gt;
&lt;li&gt; – Contains navigation links.&lt;/li&gt;
&lt;li&gt; – Represents the main content of the page.&lt;/li&gt;
&lt;li&gt; – Groups related content together.&lt;/li&gt;
&lt;li&gt; – Represents independent content such as a blog post or news article.&lt;/li&gt;
&lt;li&gt; – Contains side content related to the main content.&lt;/li&gt;
&lt;li&gt; – Defines the footer section of a page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Benefits of Semantic Tags&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve code readability and maintainability.&lt;/li&gt;
&lt;li&gt;Help search engines understand page content (SEO).&lt;/li&gt;
&lt;li&gt;Improve accessibility for screen readers and assistive technologies.&lt;/li&gt;
&lt;li&gt;Provide a clear structure to web pages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SEO&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;SEO (Search Engine Optimization) is the process of improving a website so that it ranks higher in search engine results like Google and attracts more organic (non-paid) traffic&lt;/p&gt;

&lt;p&gt;Search engines can better understand the structure and content of a webpage when semantic tags are used&lt;/p&gt;

&lt;p&gt;For example, an &lt;/p&gt; tag tells search engines that the content is a standalone article or blog post, while a  tag indicates navigation links.

&lt;p&gt;Why is SEO Important?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increases website visibility.&lt;/li&gt;
&lt;li&gt;Brings more visitors to the website.&lt;/li&gt;
&lt;li&gt;Improves user experience.&lt;/li&gt;
&lt;li&gt;Helps businesses reach their target audience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2, &lt;strong&gt;Flex vs  Grid&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;display: flex;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Flexbox (Flexible Box Layout) is a one-dimensional layout system used to arrange items in a row or a column.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Flexbox&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;Flexbox makes it easy to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Align items horizontally or vertically.&lt;/li&gt;
&lt;li&gt;Distribute space between items.&lt;/li&gt;
&lt;li&gt;Center elements.&lt;/li&gt;
&lt;li&gt;Create responsive navigation bars and card layouts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Flexbox Properties&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;flex-direction → Defines row or column layout.&lt;/li&gt;
&lt;li&gt;justify-content → Aligns items along the main axis.&lt;/li&gt;
&lt;li&gt;align-items → Aligns items along the cross axis.&lt;/li&gt;
&lt;li&gt;flex-wrap → Allows items to wrap to the next line.&lt;/li&gt;
&lt;li&gt;gap → Adds space between items.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-World Uses of Flex&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation bars&lt;/li&gt;
&lt;li&gt;Button groups&lt;/li&gt;
&lt;li&gt;Centering content&lt;/li&gt;
&lt;li&gt;Card layouts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;display: grid;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CSS Grid is a two-dimensional layout system used to arrange items in rows and columns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Grid?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Grid makes it easy to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create complex page layouts.&lt;/li&gt;
&lt;li&gt;Control rows and columns simultaneously.&lt;/li&gt;
&lt;li&gt;Build dashboards, galleries, and responsive web pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Grid Properties&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;grid-template-columns → Defines columns.&lt;/li&gt;
&lt;li&gt;grid-template-rows → Defines rows.&lt;/li&gt;
&lt;li&gt;gap → Adds space between grid items.&lt;/li&gt;
&lt;li&gt;grid-column → Controls column span.&lt;/li&gt;
&lt;li&gt;grid-row → Controls row span.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Real-World Uses&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full webpage layouts&lt;/li&gt;
&lt;li&gt;Admin dashboards&lt;/li&gt;
&lt;li&gt;Product galleries&lt;/li&gt;
&lt;li&gt;Magazine-style designs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3, &lt;strong&gt;display: none vs visibility: hidden&lt;/strong&gt;&lt;br&gt;
Both properties hide an element, but they behave differently.&lt;/p&gt;

&lt;p&gt;1.** display: none**&lt;/p&gt;

&lt;p&gt;When an element has display: none, it is completely removed from the page layout.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The element is not visible.&lt;/li&gt;
&lt;li&gt;It does not occupy any space.&lt;/li&gt;
&lt;li&gt;Other elements move up and take its place.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;visibility: hidden&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When an element has visibility: hidden, it becomes invisible but still occupies space in the layout.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The element is not visible.&lt;/li&gt;
&lt;li&gt;The space reserved for it remains.&lt;/li&gt;
&lt;li&gt;Other elements do not move&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4, &lt;strong&gt;var, let , const&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. var&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;var was the original way to declare variables before ES6.&lt;/p&gt;

&lt;p&gt;Characteristics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Function-scoped&lt;/li&gt;
&lt;li&gt;Can be re-declared&lt;/li&gt;
&lt;li&gt;Can be re-assigned&lt;/li&gt;
&lt;li&gt;Hoisted and initialized with undefined&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%2Fcdhve17s9m488f6pos3n.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%2Fcdhve17s9m488f6pos3n.png" alt=" " width="469" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2*&lt;em&gt;. let&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;Introduced in ES6 to solve some problems with var.&lt;/p&gt;

&lt;p&gt;Characteristics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block-scoped&lt;/li&gt;
&lt;li&gt;Cannot be re-declared in the same scope&lt;/li&gt;
&lt;li&gt;Can be re-assigned&lt;/li&gt;
&lt;li&gt;Hoisted but not initialized&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%2Fv3r8okveu5ly88omxnha.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%2Fv3r8okveu5ly88omxnha.png" alt=" " width="552" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3*&lt;em&gt;. const&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;Used for variables whose reference should not change.&lt;/p&gt;

&lt;p&gt;Characteristics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block-scoped&lt;/li&gt;
&lt;li&gt;Cannot be re-declared&lt;/li&gt;
&lt;li&gt;Cannot be re-assigned&lt;/li&gt;
&lt;li&gt;Must be initialized when declared&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%2F64gxz9ccn8fatprzost0.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%2F64gxz9ccn8fatprzost0.png" alt=" " width="491" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The object's contents can change, but the variable cannot point to a different object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxa08cbbdyey1nno50zq.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%2Fwxa08cbbdyey1nno50zq.png" alt=" " width="571" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4,&lt;strong&gt;JavaScript Scopes&lt;/strong&gt;&lt;br&gt;
A scope determines where a variable can be accessed in your code.&lt;/p&gt;

&lt;p&gt;There are 3 main types of scope:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9skh9s22q8zf9i0fzfxa.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%2F9skh9s22q8zf9i0fzfxa.png" alt=" " width="629" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwl0t8qpi8aa785q9r2ib.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%2Fwl0t8qpi8aa785q9r2ib.png" alt=" " width="640" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fias21o9qg5ibgx94hd1j.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%2Fias21o9qg5ibgx94hd1j.png" alt=" " width="634" height="334"&gt;&lt;/a&gt;&lt;br&gt;
Key Point&lt;br&gt;
Accessible only inside the block (if, for, while, etc.)&lt;/p&gt;

&lt;p&gt;5, &lt;strong&gt;Primitive and Non-Primitive Data Types in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Primitive Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Primitive values store a single value and are immutable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Primitive Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let num = 10;          // Number&lt;br&gt;
let name = "Vidhya";   // String&lt;br&gt;
let isActive = true;   // Boolean&lt;br&gt;
let value = null;      // Null&lt;br&gt;
let data;              // Undefined&lt;br&gt;
let id = Symbol();     // Symbol&lt;br&gt;
let bigNum = 123n;     // BigInt&lt;/p&gt;

&lt;p&gt;Stored In&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stored directly by value.&lt;/li&gt;
&lt;li&gt;stored in stack memory.&lt;/li&gt;
&lt;li&gt;Immutable Nature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once a primitive value is created, it cannot be changed. Operations create a new value instead.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Non-Primitive (Reference) Data Types&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These store collections of data or more complex entities.&lt;/p&gt;

&lt;p&gt;let arr = [1, 2, 3];          // Array&lt;br&gt;
let obj = { name: "Vidhya" }; // Object&lt;br&gt;
let fun = function() {};      // Function&lt;/p&gt;

&lt;p&gt;Stored In&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The actual data is stored by reference.&lt;/li&gt;
&lt;li&gt;stored in heap memory.&lt;/li&gt;
&lt;li&gt;Mutable Nature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Objects and arrays can be modified after creation.&lt;/p&gt;

&lt;p&gt;6,&lt;strong&gt;Type Casting in JavaScript&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Type Casting (also called Type Conversion) is the process of converting a value from one data type to another data type.&lt;/p&gt;

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

&lt;p&gt;String → Number&lt;br&gt;
Number → String&lt;br&gt;
Number → Boolean&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type Casting vs Type Coercion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type Casting (Explicit Conversion)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You convert the type manually.&lt;/p&gt;

&lt;p&gt;let num = Number("10");&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type Coercion (Implicit Conversion)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript converts the type automatically.&lt;/p&gt;

&lt;p&gt;console.log("10" - 5); // 5&lt;/p&gt;

&lt;p&gt;7,&lt;strong&gt;Ternary Operator in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Ternary Operator (? :) is a shorthand way of writing an if...else statement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;condition ? expressionIfTrue : expressionIfFalse;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the condition is true, the first expression executes.&lt;/li&gt;
&lt;li&gt;If the condition is false, the second expression executes.&lt;/li&gt;
&lt;/ul&gt;

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

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

&lt;p&gt;let result = age &amp;gt;= 18 ? "Eligible to vote" : "Not eligible to vote";&lt;/p&gt;

&lt;p&gt;console.log(result);&lt;/p&gt;

&lt;p&gt;8,&lt;strong&gt;Objects in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An Object is a non-primitive data type used to store data in key-value pairs.&lt;/p&gt;

&lt;p&gt;Objects help group related data and functionality together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbk2b9mag6171rtvu3tir.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%2Fbk2b9mag6171rtvu3tir.png" alt=" " width="550" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth6f4s20vu2jc3kn7fd3.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%2Fth6f4s20vu2jc3kn7fd3.png" alt=" " width="637" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deleting Properties&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;delete person.age;&lt;/p&gt;

&lt;p&gt;8,&lt;strong&gt;Array vs Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arrays and Objects are not the same, but they are closely related.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Similarities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Non-primitive (reference) data types&lt;/li&gt;
&lt;li&gt;Mutable&lt;/li&gt;
&lt;li&gt;Stored by reference&lt;/li&gt;
&lt;li&gt;Technically objects in JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
let arr = [1, 2, 3];&lt;br&gt;
let obj = { name: "Vidhya" };&lt;/p&gt;

&lt;p&gt;console.log(typeof arr); // object&lt;br&gt;
console.log(typeof obj); // object&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt; -An array is used to store ordered collections of values.Arrays are a special type of object in JavaScript.&lt;/p&gt;

&lt;p&gt;Array  → Index-Based Data&lt;br&gt;
Object → Key-Value Data&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Functions in Javascipt</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Mon, 08 Jun 2026 05:02:53 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascipt-19ei</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/functions-in-javascipt-19ei</guid>
      <description>&lt;p&gt;&lt;strong&gt;Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functions are reusable code blocks designed for particular tasks&lt;/li&gt;
&lt;li&gt;Functions are executed when they are called or invoked&lt;/li&gt;
&lt;li&gt;Functions are fundamental in all programming languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Use Functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions help you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse code (write once, run many times)&lt;/li&gt;
&lt;li&gt;Organize code into smaller parts&lt;/li&gt;
&lt;li&gt;Make code easier to read and maintain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What Does a Function Look Like?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function can be created with the function keyword, a name, and parentheses.&lt;/p&gt;

&lt;p&gt;The code to run is written inside curly brackets&lt;/p&gt;

&lt;p&gt;function sayHello() {&lt;br&gt;
  return "Hello World";&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions Run When You Call Them&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1h749qe9lmlt2mrk3kk.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%2Fx1h749qe9lmlt2mrk3kk.png" alt=" " width="672" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Function Syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1mire47q7i70te8vxwo4.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%2F1mire47q7i70te8vxwo4.png" alt=" " width="438" height="86"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function definition is not an executable statement.&lt;/li&gt;
&lt;li&gt;It is not common to end a function definition with a semicolon.&lt;/li&gt;
&lt;li&gt;Semicolons are used to separate executable JavaScript statements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A Function Can Be Used Many Times&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A big benefit is that you can call the same function whenever you need it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk9cz1ncuec7f3rib1qho.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%2Fk9cz1ncuec7f3rib1qho.png" alt=" " width="589" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that values returned from functions can be stored in variables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables declared within a JavaScript function, become LOCAL to the function.&lt;/p&gt;

&lt;p&gt;Local variables can only be accessed from within the function&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4vskjklc8h1e6dhtcigi.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%2F4vskjklc8h1e6dhtcigi.png" alt=" " width="536" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since local variables are only recognized inside their functions, variables with the same name can be used in different functions.&lt;br&gt;
Local variables are created when a function starts, and deleted when the function is completed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions Used as Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions can be used as variables, in all types of formulas, assignments, and calculations.&lt;/p&gt;

&lt;p&gt;let x = toCelsius(77);&lt;br&gt;
let text = "The temperature is " + x + " Celsius";&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Input and Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most useful functions work like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters - some values are sent to the function&lt;/li&gt;
&lt;li&gt;Arguments - some values are received by the function&lt;/li&gt;
&lt;li&gt;Function Code - some work is done inside the function&lt;/li&gt;
&lt;li&gt;Return Output - some value is returned from the function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference :&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.w3schools.com/js/js_function_intro.asp" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;w3schools.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>JavaScript Booleans</title>
      <dc:creator>vidhya murali</dc:creator>
      <pubDate>Thu, 04 Jun 2026 05:41:01 +0000</pubDate>
      <link>https://dev.to/vidhya_murali_5aabe7784bd/javascript-booleans-5a0n</link>
      <guid>https://dev.to/vidhya_murali_5aabe7784bd/javascript-booleans-5a0n</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Boolean Data Type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In JavaScript, a Boolean is a primitive data type that can only have one of two values:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;true&lt;/strong&gt; or &lt;strong&gt;false&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Boolean value of an expression is the basis for all JavaScript comparisons and conditions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Boolean Characteristics&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;true and false are boolean data types&lt;/li&gt;
&lt;li&gt;true and false are the only possible boolean values&lt;/li&gt;
&lt;li&gt;true and false must be written in lowercase&lt;/li&gt;
&lt;li&gt;true and false must be written without quotes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Boolean Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Very often, in programming, you will need a data type that can represent one of two values, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yes or no&lt;/li&gt;
&lt;li&gt;on or off&lt;/li&gt;
&lt;li&gt;true or false&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Boolean values are fundamental for logical operations and control flow in JavaScript programming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparisons&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All JavaScript comparison operators (like ==, !=, &amp;lt;, &amp;gt;) return true or false from the comparison.&lt;/p&gt;

&lt;p&gt;Given that x = 5, the table below explains comparison:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ud0n8qnxbdan6yhya5y.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%2F9ud0n8qnxbdan6yhya5y.png" alt=" " width="797" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Loops&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Booleans are extensively used in loops to determine conditions for looping.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6zxmyjuczrica8xvg49.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%2Fs6zxmyjuczrica8xvg49.png" alt=" " width="706" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Boolean() Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can use the Boolean() function to find out if an expression (or a variable) is true:&lt;/p&gt;

&lt;p&gt;Example : Boolean(10 &amp;gt; 9)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Everything With a "Value" is True&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmriilh475ldjh0k11nr9.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%2Fmriilh475ldjh0k11nr9.png" alt=" " width="479" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In JavaScript, both an empty array [ ] and an empty object { } are truthy because they are objects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All objects in JavaScript evaluate to true in a boolean context, regardless of their content.&lt;/p&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%2F6t8wnk2qg48lnb3nb49j.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%2F6t8wnk2qg48lnb3nb49j.png" alt=" " width="531" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Boolean value of &lt;strong&gt;"" (empty string)&lt;/strong&gt; is false:&lt;/p&gt;

&lt;p&gt;let x = "";&lt;br&gt;
Boolean(x);&lt;/p&gt;

&lt;p&gt;The Boolean value of &lt;strong&gt;-0 (minus zero)&lt;/strong&gt; is false:&lt;/p&gt;

&lt;p&gt;let x = -0;&lt;br&gt;
Boolean(x);&lt;/p&gt;

&lt;p&gt;The Boolean value of &lt;strong&gt;undefined&lt;/strong&gt; is false:&lt;/p&gt;

&lt;p&gt;let x;&lt;br&gt;
Boolean(x);&lt;/p&gt;

&lt;p&gt;The Boolean value of null is false:&lt;/p&gt;

&lt;p&gt;let x = null;&lt;br&gt;
Boolean(x);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Booleans as Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Normally JavaScript booleans are primitive values created from literals:&lt;/p&gt;

&lt;p&gt;let x = false;&lt;/p&gt;

&lt;p&gt;But booleans can also be defined as objects with the keyword new:&lt;/p&gt;

&lt;p&gt;let y = new Boolean(false);&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3j2wgywrmixe8997vapr.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%2F3j2wgywrmixe8997vapr.png" alt=" " width="501" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fw612yl8gybtaotknnu.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%2F1fw612yl8gybtaotknnu.png" alt=" " width="320" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In JavaScript, &lt;strong&gt;truthy **and **falsy&lt;/strong&gt; values are concepts related to boolean evaluation. Every value in JavaScript has an inherent boolean "truthiness" or "falsiness," which means they can be implicitly evaluated to true or false in boolean contexts, such as in conditional statements or logical operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Are Truthy Values?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Truthy values are values that are evaluated to be true when used in a Boolean context. Simply put, any value that is not explicitly falsy is considered truthy&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Non-zero numbers: 42, -1, 3.14&lt;/li&gt;
&lt;li&gt;Non-empty strings: "hello", "0", " "&lt;/li&gt;
&lt;li&gt;Objects and arrays: {}, []&lt;/li&gt;
&lt;li&gt;Functions: function() {}&lt;/li&gt;
&lt;li&gt;Dates: new Date()&lt;/li&gt;
&lt;li&gt;Symbols: Symbol()&lt;/li&gt;
&lt;li&gt;BigInt values other than 0n: 10n&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What Are Falsy Values?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Falsy values are values that evaluate to false when used in a Boolean. JavaScript has a fixed list of falsy values&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;false&lt;/li&gt;
&lt;li&gt;0 (and -0)&lt;/li&gt;
&lt;li&gt;0n (BigInt zero)&lt;/li&gt;
&lt;li&gt;"" (empty string)&lt;/li&gt;
&lt;li&gt;null&lt;/li&gt;
&lt;li&gt;undefined&lt;/li&gt;
&lt;li&gt;NaN&lt;/li&gt;
&lt;li&gt;document.all (used for backward compatibility&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%2Fduott3m3ckkclo7avll7.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%2Fduott3m3ckkclo7avll7.png" alt=" " width="752" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8q0fvp7l1ij8mdgdvr9.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%2Ft8q0fvp7l1ij8mdgdvr9.png" alt=" " width="681" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulg79xs3rme8brl3bw57.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%2Fulg79xs3rme8brl3bw57.png" alt=" " width="711" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Do not create Boolean objects.&lt;/p&gt;

&lt;p&gt;The new keyword complicates the code and slows down execution speed.&lt;/p&gt;

&lt;p&gt;Boolean objects can produce unexpected results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ciw3ryu4t65i6d7ljqk.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%2F3ciw3ryu4t65i6d7ljqk.png" alt=" " width="573" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference :&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.w3schools.com/js/js_booleans.asp" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;w3schools.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>ai</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
