<?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: Chandru</title>
    <description>The latest articles on DEV Community by Chandru (@candyx3).</description>
    <link>https://dev.to/candyx3</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%2F4071449%2F3771e142-2e37-48ec-81a0-b32cb9c6b6d2.png</url>
      <title>DEV Community: Chandru</title>
      <link>https://dev.to/candyx3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/candyx3"/>
    <language>en</language>
    <item>
      <title>JavaScript `async` and `await`</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Wed, 16 Sep 2026 09:21:58 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-async-and-await-7pi</link>
      <guid>https://dev.to/candyx3/javascript-async-and-await-7pi</guid>
      <description>&lt;p&gt;When working with APIs or other asynchronous operations in JavaScript, you'll often use &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;They make asynchronous code easier to read and understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;async&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;async&lt;/code&gt; keyword makes a function return a Promise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because it's an async function, the result is a Promise.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;await&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;await&lt;/code&gt; waits for a Promise to finish before continuing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of writing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can use &lt;code&gt;async/await&lt;/code&gt;, which is usually easier to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error handling
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;try...catch&lt;/code&gt; to handle errors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Simple rule to remember
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async → makes a function return a Promise
await → waits for a Promise
try/catch → handles errors
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the basic idea behind &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; in JavaScript.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Callback Function in JavaScript</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Wed, 09 Sep 2026 05:59:33 +0000</pubDate>
      <link>https://dev.to/candyx3/callback-function-in-javascript-33hm</link>
      <guid>https://dev.to/candyx3/callback-function-in-javascript-33hm</guid>
      <description>&lt;p&gt;A callback function is a function that is passed as an argument to another function and is called later when needed.&lt;/p&gt;

&lt;p&gt;Here is a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;processUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;processUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello John
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;greet&lt;/code&gt; is the callback function because we pass it to &lt;code&gt;processUser()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;processUser()&lt;/code&gt; function then calls it using &lt;code&gt;callback("John")&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In simple words:&lt;/p&gt;

&lt;p&gt;A callback is a function passed to another function to be executed later.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Constructors and Arrays: What I Learned</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Tue, 08 Sep 2026 06:33:48 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-constructors-and-arrays-what-i-learned-54oc</link>
      <guid>https://dev.to/candyx3/javascript-constructors-and-arrays-what-i-learned-54oc</guid>
      <description>&lt;p&gt;While learning JavaScript objects, I came across constructors and arrays.&lt;/p&gt;

&lt;p&gt;Both sounded a little confusing at first, but after using them, they became much easier to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Constructors
&lt;/h2&gt;

&lt;p&gt;A constructor is useful when we want to create multiple objects with the same structure.&lt;/p&gt;

&lt;p&gt;For example, if we want to create multiple users, we don't have to write the same object again and again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can create users using &lt;code&gt;new&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can create more users using the same constructor.&lt;/p&gt;

&lt;p&gt;In modern JavaScript, we can also use a class with a constructor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The basic idea is simple: constructors help us create similar objects easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;Arrays are used when we want to store multiple values in one place.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mango&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Orange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Array indexes start from 0, so &lt;code&gt;fruits[0]&lt;/code&gt; gives us &lt;code&gt;"Apple"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are many array methods in JavaScript. Here are some basic ones I found useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  length
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;length&lt;/code&gt; tells us how many items are in the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It converts the array into a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It returns an item at a particular position.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It joins the array elements using the separator we provide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; - &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It adds an item to the end of the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It removes the last item.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It removes the first item.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It adds an item to the beginning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Grapes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It can be used to combine arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Kiwi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It returns a part of an array without changing the original array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It can be used to add, remove, or replace items in an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It is useful when an array contains other arrays and we want to flatten them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flat&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;It checks whether a value is actually an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are many more array methods in JavaScript, but these are some good ones to start with.&lt;/p&gt;

&lt;p&gt;The ones I use most often are probably &lt;code&gt;push()&lt;/code&gt;, &lt;code&gt;pop()&lt;/code&gt;, &lt;code&gt;shift()&lt;/code&gt;, &lt;code&gt;unshift()&lt;/code&gt;, &lt;code&gt;slice()&lt;/code&gt;, &lt;code&gt;splice()&lt;/code&gt;, and &lt;code&gt;concat()&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Objects: What I Learned</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Sun, 06 Sep 2026 06:30:40 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-objects-what-i-learned-4b42</link>
      <guid>https://dev.to/candyx3/javascript-objects-what-i-learned-4b42</guid>
      <description>&lt;p&gt;After learning strings and functions, the next topic I came across was objects.&lt;/p&gt;

&lt;p&gt;An object is a way to keep related information together. Instead of creating separate variables for a person's name, age, and city, we can put them inside one object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt; are called properties.&lt;/p&gt;

&lt;p&gt;We can access a property using a dot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also change the value later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objects can contain different types of data too. We can have strings, numbers, arrays, and even functions inside an object.&lt;/p&gt;

&lt;p&gt;When a function is inside an object, we usually call it a method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can call it using &lt;code&gt;person.greet()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Objects are used a lot in JavaScript. You'll see them when working with users, products, API responses, settings, and many other things.&lt;/p&gt;

&lt;p&gt;The main thing I learned is that objects are a simple way to organize related data in one place.&lt;/p&gt;

&lt;p&gt;At first, objects can feel a little confusing, but after using them in a few examples, they start to feel much more natural.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>JavaScript Strings: The Basics I Learned</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Fri, 04 Sep 2026 09:04:14 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-strings-the-basics-i-learned-113p</link>
      <guid>https://dev.to/candyx3/javascript-strings-the-basics-i-learned-113p</guid>
      <description>&lt;p&gt;Strings are one of the first things we use when learning JavaScript.&lt;/p&gt;

&lt;p&gt;Simply put, a string is just text.&lt;/p&gt;

&lt;p&gt;There are three common ways to create strings in JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Single Quotes
&lt;/h2&gt;

&lt;p&gt;We can use single quotes to create a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Double Quotes
&lt;/h2&gt;

&lt;p&gt;We can also use double quotes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both single and double quotes work in a similar way. It's mostly a matter of which style you prefer or what the project uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Template Literals
&lt;/h2&gt;

&lt;p&gt;Template literals use backticks instead of quotes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Hello &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I find template literals especially useful when we need to include variables inside a string.&lt;/p&gt;

&lt;p&gt;For example, instead of joining strings with &lt;code&gt;+&lt;/code&gt;, we can directly put the variable inside &lt;code&gt;${}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Useful String Methods
&lt;/h2&gt;

&lt;p&gt;JavaScript has many built-in methods for working with strings.&lt;/p&gt;

&lt;p&gt;We can change text to uppercase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or lowercase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also check how many characters are in a string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another useful one is &lt;code&gt;includes()&lt;/code&gt;, which checks whether a string contains some text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;he&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Strings may seem very basic, but we use them everywhere in JavaScript — names, messages, search boxes, URLs, API data, and much more.&lt;/p&gt;

&lt;p&gt;The main thing to remember is:&lt;/p&gt;

&lt;p&gt;Single quotes → &lt;code&gt;'Hello'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Double quotes → &lt;code&gt;"Hello"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Template literals → &lt;code&gt;`Hello ${name}`&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Types of Functions in JavaScript</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Thu, 03 Sep 2026 06:25:14 +0000</pubDate>
      <link>https://dev.to/candyx3/types-of-functions-in-javascript-53m2</link>
      <guid>https://dev.to/candyx3/types-of-functions-in-javascript-53m2</guid>
      <description>&lt;p&gt;After learning what functions are in JavaScript, I came across different ways of writing them.&lt;/p&gt;

&lt;p&gt;At first, I thought they were all completely different. But after trying them out, I realized the main difference is just how we write and use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function Declaration
&lt;/h2&gt;

&lt;p&gt;This is the normal way of creating a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can call it whenever we need it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is probably the easiest one to understand when you're starting out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function Expression
&lt;/h2&gt;

&lt;p&gt;Here, we assign a function to a variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works like a normal function, but the function is stored inside the variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow Function
&lt;/h2&gt;

&lt;p&gt;Arrow functions are a shorter way of writing functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see these a lot in modern JavaScript, especially when working with arrays and frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anonymous Function
&lt;/h2&gt;

&lt;p&gt;An anonymous function is simply a function that doesn't have a name.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the function is passed directly to setTimeout, so we don't need to give it a name.&lt;/p&gt;

&lt;h2&gt;
  
  
  IIFE
&lt;/h2&gt;

&lt;p&gt;IIFE stands for Immediately Invoked Function Expression.&lt;/p&gt;

&lt;p&gt;The name sounds complicated, but the idea is simple. The function runs immediately after it is created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may not use IIFE very often in modern JavaScript, but it's still good to know what it means when you see it in existing code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from this
&lt;/h2&gt;

&lt;p&gt;There are several ways to write functions, but I don't think you need to memorize all of them at once.&lt;/p&gt;

&lt;p&gt;Start with function declarations and arrow functions. Once you're comfortable with those, the other types will be much easier to understand.&lt;/p&gt;

&lt;p&gt;The more JavaScript you write, the more naturally you'll know which one to use.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Functions: A Simple Explanation</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Wed, 02 Sep 2026 05:34:39 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-functions-a-simple-explanation-3ih2</link>
      <guid>https://dev.to/candyx3/javascript-functions-a-simple-explanation-3ih2</guid>
      <description>&lt;p&gt;While learning JavaScript, one topic that I found really important was functions.&lt;/p&gt;

&lt;p&gt;A function is basically a block of code that we can write once and use whenever we need it.&lt;/p&gt;

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

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

&lt;p&gt;We can run the function by calling it:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Functions with Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes we want to give some information to a function. That's where parameters come in.&lt;/p&gt;

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

&lt;p&gt;Now we can pass different names when calling the function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Return&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A function can also give a value back using return.&lt;/p&gt;

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

&lt;p&gt;We can then store the result in a variable and use it wherever we need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are functions useful?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without functions, we might end up writing the same code again and again.&lt;/p&gt;

&lt;p&gt;Functions help us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse code&lt;/li&gt;
&lt;li&gt;Keep code organized&lt;/li&gt;
&lt;li&gt;Avoid repetition&lt;/li&gt;
&lt;li&gt;Make programs easier to understand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main thing I learned is that functions are not just about writing code in a different format. They help us break a bigger problem into smaller, reusable pieces.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>learning</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>4 JavaScript Things I Learned Recently</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Tue, 01 Sep 2026 05:56:35 +0000</pubDate>
      <link>https://dev.to/candyx3/4-javascript-things-i-learned-recently-19f0</link>
      <guid>https://dev.to/candyx3/4-javascript-things-i-learned-recently-19f0</guid>
      <description>&lt;p&gt;While learning JavaScript, I came across a few things that I had seen before but didn't fully understand: ternary, switch, break, and continue.&lt;/p&gt;

&lt;p&gt;After trying them with small examples, they started making more sense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ternary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ternary operator is basically a short way of writing if-else.&lt;/p&gt;

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

&lt;p&gt;let result = age &amp;gt;= 18 ? "Adult" : "Minor";&lt;/p&gt;

&lt;p&gt;It is useful when the condition is simple and you want to keep the code short.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Switch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Switch is useful when you need to check one value against different options.&lt;/p&gt;

&lt;p&gt;For example, if we want to check the day:&lt;/p&gt;

&lt;p&gt;switch (day) {&lt;br&gt;
  case "Monday": console.log("Start");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;We can add more cases depending on what we need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Break&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Break is used when we want to stop a loop.&lt;/p&gt;

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

&lt;p&gt;if (i === 5) break;&lt;/p&gt;

&lt;p&gt;When the condition is true, the loop stops there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Continue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Continue is different from break.&lt;/p&gt;

&lt;p&gt;It skips the current iteration but allows the loop to keep running.&lt;/p&gt;

&lt;p&gt;if (i === 5) continue;&lt;/p&gt;

&lt;p&gt;So, the way I remember them is:&lt;/p&gt;

&lt;p&gt;Ternary → shorter if-else&lt;/p&gt;

&lt;p&gt;Switch → different cases&lt;/p&gt;

&lt;p&gt;Break → stop&lt;/p&gt;

&lt;p&gt;Continue → skip and move on&lt;/p&gt;

&lt;p&gt;These are small things, but understanding them makes JavaScript a little easier to work with.&lt;/p&gt;

&lt;p&gt;I'm still learning, but I've found that writing small examples is much better than just reading about the syntax.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>learning</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Conditions and Loops: A Simple Explanation</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Mon, 31 Aug 2026 05:29:52 +0000</pubDate>
      <link>https://dev.to/candyx3/javascript-conditions-and-loops-a-simple-explanation-2ada</link>
      <guid>https://dev.to/candyx3/javascript-conditions-and-loops-a-simple-explanation-2ada</guid>
      <description>&lt;p&gt;When I started learning JavaScript, conditions and loops were two topics I came across pretty early.&lt;/p&gt;

&lt;p&gt;They may look confusing at first, but the idea is actually simple.&lt;/p&gt;

&lt;p&gt;Conditions are used when we want JavaScript to make a decision. For example, if a user is logged in, we can show their profile. If not, we can ask them to log in.&lt;/p&gt;

&lt;p&gt;if (isLoggedIn) {&lt;br&gt;
  console.log("Welcome!");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;We can also use else when there are two possible situations.&lt;/p&gt;

&lt;p&gt;Loops are used when we want to repeat something without writing the same code again and again.&lt;/p&gt;

&lt;p&gt;For example, if we want to print numbers from 1 to 5:&lt;/p&gt;

&lt;p&gt;for (let i = 1; i &amp;lt;= 5; i++) {&lt;br&gt;
  console.log(i);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;There are different types of loops in JavaScript, like for and while. Which one we use depends on what we are trying to do.&lt;/p&gt;

&lt;p&gt;The main thing I learned is that conditions help us make decisions, while loops help us repeat tasks.&lt;/p&gt;

&lt;p&gt;Once you understand these two concepts, writing JavaScript becomes a lot easier because you'll use them in many real projects.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Agile Methodology Explained: A Beginner’s Guide to Agile</title>
      <dc:creator>Chandru</dc:creator>
      <pubDate>Tue, 11 Aug 2026 11:43:22 +0000</pubDate>
      <link>https://dev.to/candyx3/agile-methodology-explained-a-beginners-guide-to-agile-46il</link>
      <guid>https://dev.to/candyx3/agile-methodology-explained-a-beginners-guide-to-agile-46il</guid>
      <description>&lt;p&gt;Agile Methodology Explained in Simple Words&lt;/p&gt;

&lt;p&gt;When I first heard the term Agile methodology, I thought it was just another technical word I had to remember.&lt;/p&gt;

&lt;p&gt;But after understanding it, I realized the basic idea is actually pretty simple.&lt;/p&gt;

&lt;p&gt;Agile is a way of developing software where you build things step by step, take feedback, and make changes along the way.&lt;/p&gt;

&lt;p&gt;So, how does it work?&lt;/p&gt;

&lt;p&gt;Let's say a team is building a food delivery app.&lt;/p&gt;

&lt;p&gt;Instead of developing the whole application and showing it to the customer after a few months, the team breaks the work into smaller parts.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;First, they work on login and registration.&lt;/li&gt;
&lt;li&gt;Then they work on restaurant search.&lt;/li&gt;
&lt;li&gt;After that, they add the cart and payment.&lt;/li&gt;
&lt;li&gt;Finally, they work on order tracking and other features.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The team keeps testing and getting feedback throughout the process.&lt;/p&gt;

&lt;p&gt;This is useful because requirements can change. Maybe the customer wants a different feature or the team finds a problem. With Agile, it is easier to adjust things instead of changing the whole project at the end.&lt;/p&gt;

&lt;p&gt;What is a Sprint?&lt;/p&gt;

&lt;p&gt;A Sprint is simply a short period where the team focuses on a particular set of tasks.&lt;/p&gt;

&lt;p&gt;For example, in a two-week Sprint, the team might decide to complete the login system.&lt;/p&gt;

&lt;p&gt;At the end of the Sprint, the team checks what was completed, what went wrong, and what needs to be done next.&lt;/p&gt;

&lt;p&gt;You might also hear terms like Backlog, Daily Stand-up, Sprint Review, and Retrospective when working with Agile teams.&lt;/p&gt;

&lt;p&gt;You don't need to memorize all of them immediately. Once you see how an Agile team works, these terms start making more sense.&lt;/p&gt;

&lt;p&gt;Agile and Scrum are not the same.&lt;/p&gt;

&lt;p&gt;This confused me at first too.&lt;/p&gt;

&lt;p&gt;Agile is the overall approach, while Scrum is one of the frameworks used to follow Agile principles.&lt;/p&gt;

&lt;p&gt;Why do companies use Agile?&lt;/p&gt;

&lt;p&gt;The main reason is flexibility.&lt;/p&gt;

&lt;p&gt;Software projects rarely go exactly according to the original plan. Requirements change, bugs appear, and users give new feedback.&lt;/p&gt;

&lt;p&gt;Agile makes it easier to deal with these changes because the team works in smaller cycles instead of waiting until the very end.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;You don't need to know every Agile term to understand Agile.&lt;/p&gt;

&lt;p&gt;The main idea is:&lt;/p&gt;

&lt;p&gt;Build → Test → Get feedback → Improve → Repeat&lt;/p&gt;

&lt;p&gt;That's pretty much Agile at its core.&lt;/p&gt;

&lt;p&gt;If you're just starting out in software development, learning the basics of Agile is useful because you'll probably come across it in real-world projects and job descriptions.&lt;/p&gt;

</description>
      <category>agile</category>
      <category>softwaredevelopment</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
