<?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>Forem: Deva I</title>
    <description>The latest articles on Forem by Deva I (@deva_i_932c8869ada96d4c9f).</description>
    <link>https://forem.com/deva_i_932c8869ada96d4c9f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3798144%2F9feab75e-fc8a-4f36-a8cd-6991d3e43de5.png</url>
      <title>Forem: Deva I</title>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/deva_i_932c8869ada96d4c9f"/>
    <language>en</language>
    <item>
      <title>Javascript Scenario question using (variables, operators, conditional statements) - 2</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Sat, 18 Apr 2026 15:25:40 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/javascript-scenario-question-using-variables-operators-conditional-statements-2-33ic</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/javascript-scenario-question-using-variables-operators-conditional-statements-2-33ic</guid>
      <description>&lt;h2&gt;
  
  
  1. Check number is even or odd:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&lt;br&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%2F15zkzbqccjn0mzvcr6z1.jpg" 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%2F15zkzbqccjn0mzvcr6z1.jpg" alt=" " width="720" height="400"&gt;&lt;/a&gt;&lt;br&gt;
OUTPUT:&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%2Fpml9gd1xk08x5m92lano.jpg" 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%2Fpml9gd1xk08x5m92lano.jpg" alt=" " width="720" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Compare two passwords entered by user.
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2F79uecn92zohl98dcq1h5.jpg" 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%2F79uecn92zohl98dcq1h5.jpg" alt=" " width="719" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fm1paxwvn8yqpkr66uapu.jpg" 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%2Fm1paxwvn8yqpkr66uapu.jpg" alt=" " width="720" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Write condition if person age &amp;gt;= 18 is eligible to vote:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fs28j85rai7gt4f7u9zy2.jpg" 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%2Fs28j85rai7gt4f7u9zy2.jpg" alt=" " width="720" height="464"&gt;&lt;/a&gt;&lt;br&gt;
OUTPUT:&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%2Faau4wz4gb0secuo4miaf.jpg" 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%2Faau4wz4gb0secuo4miaf.jpg" alt=" " width="720" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Use logical AND to check:
&lt;/h2&gt;

&lt;p&gt;▪️User is logged in&lt;/p&gt;

&lt;p&gt;▪️User is admin Then allow dashboard access.&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2F3lr791xtjuqyqddv95hs.jpg" 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%2F3lr791xtjuqyqddv95hs.jpg" alt=" " width="720" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fjmvpbbtfoqrn3gw392rq.jpg" 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%2Fjmvpbbtfoqrn3gw392rq.jpg" alt=" " width="720" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5.calculates total cart amount:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fxncitcjq02twhpey3ur8.jpg" 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%2Fxncitcjq02twhpey3ur8.jpg" alt=" " width="720" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fpwd1f12ei86ow8vrl6uf.jpg" 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%2Fpwd1f12ei86ow8vrl6uf.jpg" alt=" " width="720" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. greet a user by name:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2F6knhoj5ollqxv99962hx.jpg" 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%2F6knhoj5ollqxv99962hx.jpg" alt=" " width="720" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fttu7r6ojcipkvw41mv1w.jpg" 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%2Fttu7r6ojcipkvw41mv1w.jpg" alt=" " width="720" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. convert Celsius to Fahrenheit:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fo7dm8obmlfggsxdzib8n.jpg" 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%2Fo7dm8obmlfggsxdzib8n.jpg" alt=" " width="720" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fsy877civgllzrnvqwk50.jpg" 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%2Fsy877civgllzrnvqwk50.jpg" alt=" " width="720" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. returns the largest of two numbers:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fuqiwh2fwwvpqw4acwc36.jpg" 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%2Fuqiwh2fwwvpqw4acwc36.jpg" alt=" " width="720" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F9h0butllycqa0nixedan.jpg" 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%2F9h0butllycqa0nixedan.jpg" alt=" " width="720" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Check user role:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fr6o8uq35kdd6i1dww8ma.jpg" 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%2Fr6o8uq35kdd6i1dww8ma.jpg" alt=" " width="720" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fkmdwec6wyey6kuh1xkmo.jpg" 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%2Fkmdwec6wyey6kuh1xkmo.jpg" alt=" " width="720" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Check number is positive, negative, or zero:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fy285224sfuo84dnufbcg.jpg" 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%2Fy285224sfuo84dnufbcg.jpg" alt=" " width="720" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fxmkfnly942hz0xj6uysm.jpg" 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%2Fxmkfnly942hz0xj6uysm.jpg" alt=" " width="720" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Check a year is leap year:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fqun7xu632xtyuowft7ef.jpg" 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%2Fqun7xu632xtyuowft7ef.jpg" alt=" " width="720" height="415"&gt;&lt;/a&gt;&lt;br&gt;
OUTPUT:&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%2Fd4fwu8dk2gdp9mbo84e3.jpg" 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%2Fd4fwu8dk2gdp9mbo84e3.jpg" alt=" " width="720" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Movie ticket pricing:child age below 12-&amp;gt;100, adult age above 12-&amp;gt;200:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fd7pavxzwz0z7ok7z84g8.jpg" 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%2Fd7pavxzwz0z7ok7z84g8.jpg" alt=" " width="720" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fc7nt8cx8kn5okvu1cuav.jpg" 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%2Fc7nt8cx8kn5okvu1cuav.jpg" alt=" " width="720" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  13. If marks &amp;gt;= 90 Grade A,75→ Grade B else → Fail:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fvujou9iwnxnidtluyckd.jpg" 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%2Fvujou9iwnxnidtluyckd.jpg" alt=" " width="720" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fumjwm577ao19e1qfezap.jpg" 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%2Fumjwm577ao19e1qfezap.jpg" alt=" " width="720" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>coding</category>
    </item>
    <item>
      <title>JavaScript scenario questions using(Variables, operators, conditional Statements)</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Sat, 18 Apr 2026 05:29:19 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/javascript-scenario-questions-usingvariables-operators-conditional-statements-31fj</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/javascript-scenario-questions-usingvariables-operators-conditional-statements-31fj</guid>
      <description>&lt;h2&gt;
  
  
  1. building a login system:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2F778oeeufnvrdrm1upfgi.jpg" 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%2F778oeeufnvrdrm1upfgi.jpg" alt=" " width="720" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Ftcg78jryp8doy5a2bewy.jpg" 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%2Ftcg78jryp8doy5a2bewy.jpg" alt=" " width="720" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Print a given message:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fw1mq7eufbk0cqodbt8j0.jpg" 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%2Fw1mq7eufbk0cqodbt8j0.jpg" alt=" " width="720" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F4udj3vh95jjezuhp815y.jpg" 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%2F4udj3vh95jjezuhp815y.jpg" alt=" " width="720" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. calculate the student marks:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fughkoprdbq0yuj9faii7.jpg" 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%2Fughkoprdbq0yuj9faii7.jpg" alt=" " width="720" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F9v1gs1qzku93hq6wvkfy.jpg" 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%2F9v1gs1qzku93hq6wvkfy.jpg" alt=" " width="720" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Swap two numbers without using a third variable.
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Fsu5ewxfjp3fznesnobon.jpg" 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%2Fsu5ewxfjp3fznesnobon.jpg" alt=" " width="720" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Frwx8nklcny77264wdc4u.jpg" 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%2Frwx8nklcny77264wdc4u.jpg" alt=" " width="720" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. User is logged in or not and show a message:
&lt;/h2&gt;

&lt;p&gt;PROGRAM:&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%2Ftlbmqkmthb1aog9y42js.jpg" 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%2Ftlbmqkmthb1aog9y42js.jpg" alt=" " width="720" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fh8plzfhakpydcdqo0y11.jpg" 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%2Fh8plzfhakpydcdqo0y11.jpg" alt=" " width="720" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Objects &amp; Array Scenario Questions</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Fri, 17 Apr 2026 09:35:02 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/objects-array-scenario-questions-2722</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/objects-array-scenario-questions-2722</guid>
      <description>&lt;h2&gt;
  
  
  1. User Profile Update
&lt;/h2&gt;

&lt;p&gt;const user = {&lt;/p&gt;

&lt;p&gt;name: "Vijay",&lt;/p&gt;

&lt;p&gt;age: 25,&lt;/p&gt;

&lt;p&gt;email: "&lt;a href="mailto:ideva4739@gmail.com"&gt;ideva4739@gmail.com&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;};&lt;/p&gt;

&lt;p&gt;▪️Update email and a new property is active = true.&lt;/p&gt;

&lt;p&gt;PROGRAM:&lt;br&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%2Fj5mtyi1wpaxkng5xga45.jpg" 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%2Fj5mtyi1wpaxkng5xga45.jpg" alt=" " width="720" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EXPLANATION:&lt;/p&gt;

&lt;p&gt;🔹In this question first condition update a new email instead of existing email.&lt;/p&gt;

&lt;p&gt;🔹If you want update a values give object name and update value in between (.)dot operator.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;▪️dot operator is used to            seperate the object name and key name.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🔹So, give user.email= &lt;a href="mailto:ideva537@gmail.com"&gt;ideva537@gmail.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;🔹Then add a new element is active= true.&lt;/p&gt;

&lt;p&gt;🔹So, create new variable user.isActive= true.&lt;/p&gt;

&lt;p&gt;🔹Then print the user.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fb3f1j8cprjfn7sayydhp.jpg" 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%2Fb3f1j8cprjfn7sayydhp.jpg" alt=" " width="720" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Shopping Cart Total
&lt;/h2&gt;

&lt;p&gt;const cart = [&lt;/p&gt;

&lt;p&gt;(name: "Shirt", price: 500).&lt;/p&gt;

&lt;p&gt;(name: "Shoes", price: 1500).&lt;/p&gt;

&lt;p&gt;(name: "Cap", price: 300)&lt;/p&gt;

&lt;p&gt;▪️Calculate total price.&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2Fqzt87i7vftudx2hozmvd.jpg" 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%2Fqzt87i7vftudx2hozmvd.jpg" alt=" " width="720" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fxvu8b7kcx0py5iiim92d.jpg" 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%2Fxvu8b7kcx0py5iiim92d.jpg" alt=" " width="720" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Find Specific Object
&lt;/h2&gt;

&lt;p&gt;const users =[&lt;br&gt;
{name: "Vijay", age: 25}, &lt;br&gt;
{name: "Arun", age: 30}, &lt;br&gt;
{name: "Kumar", age: 28}&lt;br&gt;
];&lt;/p&gt;

&lt;p&gt;▪️From an array of users, find the user whose name is "Arun"&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2Fh6tdlmnd76cz6o0qt4nw.jpg" 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%2Fh6tdlmnd76cz6o0qt4nw.jpg" alt=" " width="720" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fydq4wy7h84lprjgjf9zc.jpg" 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%2Fydq4wy7h84lprjgjf9zc.jpg" alt=" " width="720" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Add Item to Array
&lt;/h2&gt;

&lt;p&gt;const products= [&lt;br&gt;
{name: "Shirt", price: 500},&lt;br&gt;
{name: "Shoes", price: 1500}&lt;br&gt;
];&lt;br&gt;
▪️Add a new property to an existing array.&lt;/p&gt;

&lt;p&gt;▪️Remove the product name "Shoes" from the array.&lt;/p&gt;

&lt;p&gt;▪️From product list return price &amp;gt; 1000 items only.&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2F1st3frp7taebysgalpwa.jpg" 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%2F1st3frp7taebysgalpwa.jpg" alt=" " width="720" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F2y8d3ra9xdzmgmqcevl5.jpg" 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%2F2y8d3ra9xdzmgmqcevl5.jpg" alt=" " width="720" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Count Items in Object
&lt;/h2&gt;

&lt;p&gt;const fruits = {&lt;br&gt;
   apple: 2,&lt;br&gt;
   banana: 5, &lt;br&gt;
   mango: 3 &lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;▪️Find the total number of fruits.&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2Fj2dpcvmtt73wiegtda3z.jpg" 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%2Fj2dpcvmtt73wiegtda3z.jpg" alt=" " width="720" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F6vyukff8c75w5m9fb6p6.jpg" 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%2F6vyukff8c75w5m9fb6p6.jpg" alt=" " width="720" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Convert Array to Object
&lt;/h2&gt;

&lt;p&gt;const users = ["Vijay", "Arun", "Kumar"];&lt;/p&gt;

&lt;p&gt;▪️Convert into:&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vijay: true,

Arun: true,

Kumar: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2F5xdge8of6skyxbkz5ues.jpg" 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%2F5xdge8of6skyxbkz5ues.jpg" alt=" " width="720" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F95lfy6xy3tcky8z1pcwe.jpg" 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%2F95lfy6xy3tcky8z1pcwe.jpg" alt=" " width="720" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Detail About These Interview Questions: 1.What is Javascript 2.Data types in Js and Difference Between Primitive and Non Primitive 3.Variable in js</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Thu, 09 Apr 2026 16:05:44 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/detail-about-these-interview-questions-1what-is-javascript-2data-types-in-js-and-difference-3kef</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/detail-about-these-interview-questions-1what-is-javascript-2data-types-in-js-and-difference-3kef</guid>
      <description>&lt;h2&gt;
  
  
  1.What is Javascript:
&lt;/h2&gt;

&lt;p&gt;◾Java script is a high level programing language that used alongside HTML and CSS.&lt;/p&gt;

&lt;p&gt;◾It's a object oriented programming language.&lt;/p&gt;

&lt;p&gt;◾It is used to define the behaviour of the HTML and CSS,&lt;/p&gt;

&lt;p&gt;◾Java script is a most widely used frontend language in the world wide.&lt;/p&gt;

&lt;p&gt;◾It is used for interact web application and supports both client side and server side development. &lt;/p&gt;

&lt;p&gt;◾Client side means code runs on the user's computer and server side means it's runs on the web browser.&lt;/p&gt;

&lt;p&gt;◾JavaScript is a single-threaded language that executes one task at a time.&lt;/p&gt;

&lt;p&gt;◾Java script was created by BRENDON EICH in 1995.He's a computer programmer and technology executive.&lt;/p&gt;

&lt;p&gt;◾Brendon takes only 10 days to create java script.&lt;/p&gt;

&lt;p&gt;◾Java script mainly used browsers,not only browser also on servers, mobile apps and AI tools.&lt;/p&gt;

&lt;p&gt;1.Why this language has the name of Java script?&lt;/p&gt;

&lt;p&gt;✓ In the initial stage it was named by "MOCHA" and later renamed "LIVE SCRIPT"&lt;/p&gt;

&lt;p&gt;✓ Then they conclude the popularity of JAVA language at the time,so its inspired JAVA language to renamed "JAVA SCRIPT".&lt;/p&gt;

&lt;p&gt;2.Why java script is a scripting language?&lt;/p&gt;

&lt;p&gt;✓ Java script does not need any compiler to run this code,they run on runtime browsers&lt;/p&gt;

&lt;p&gt;✓ It is interpreted line by line execution.&lt;/p&gt;

&lt;p&gt;✓ Example Java code need a compiler to read the code to machine language(binary) and then to compiled servers,but javascript does not need compilers to convert machine language they directly runs on browsers.&lt;/p&gt;

&lt;p&gt;✓ Python is one of the most popular  scripting languages. Known for its simple syntax and readability&lt;/p&gt;

&lt;h2&gt;
  
  
  2.What are the data types are in javascript?
&lt;/h2&gt;

&lt;p&gt;∆ Data types are two types,they are&lt;br&gt;
1.primitive data type&lt;br&gt;
2.non primitive data type&lt;/p&gt;

&lt;p&gt;∆ Javascript using 8 primitive data types,they are Number,Boolean, Bigint,String, Undefined,Null,Nan and Symbol.&lt;/p&gt;

&lt;p&gt;Number:&lt;br&gt;
✓ Its using to denote numbers like&lt;br&gt;
Ex:19,12,4,2&lt;/p&gt;

&lt;p&gt;Boolean:&lt;br&gt;
✓ boolean denoted by true or false.&lt;/p&gt;

&lt;p&gt;Bigint:&lt;br&gt;
✓ Normally integer values are number,on the other hand bigint means big numbers.&lt;br&gt;
Ex:2527788373782,2773993736.&lt;/p&gt;

&lt;p&gt;String:&lt;br&gt;
✓ Strings are set of characters enclosed single''or double""quotes.&lt;br&gt;
Ex:"Deva",'blog'.&lt;/p&gt;

&lt;p&gt;Undefined:&lt;br&gt;
✓ Undefined is variable can be exist but not value assigned&lt;/p&gt;

&lt;p&gt;Null:&lt;br&gt;
✓ Null is denoted by empty value or 0 value.&lt;/p&gt;

&lt;p&gt;Symbol:&lt;br&gt;
✓ This used to unique symbol like percentage,greater than and lessthan etc.&lt;/p&gt;

&lt;p&gt;∆ Non primitive data types are object, array and function.&lt;/p&gt;

&lt;p&gt;Object:&lt;br&gt;
✓ Object is a collection of key value pairs used to store data and entities.&lt;/p&gt;

&lt;p&gt;✓ Denoted using curley braces{}&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const user = { name: "Deva", age: 22 };
console.log(user.name);// Output: Deva
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Array:&lt;br&gt;
✓ Array is one of the object and used for storing multiple elements in a single container.&lt;/p&gt;

&lt;p&gt;✓ Arrays are denoted in square brackets[].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const colors = ["red", "green", "blue"];
console.log(colors[0]); // Returns red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function:&lt;br&gt;
✓ A function is a reusable block of code designed to perform a specific task&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function welcome(name) {
  return "Hello, " + name;
}
console.log(welcome("Deva"));// Output: Hello Deva
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Difference Between Primitive and Non Primitive Data Types:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Primitive Data types:
&lt;/h2&gt;

&lt;p&gt;◾&lt;code&gt;Immutable&lt;/code&gt;: Values cannot be changed.&lt;/p&gt;

&lt;p&gt;◾ Immutable means if the value reassign does not replace a memory of older one's.Rather than creates a new memory to store the value.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let i = 10;
    i = 12;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹In the above example the variable are declared and initialize the value 10.&lt;/p&gt;

&lt;p&gt;🔹Then reassign the value 12.&lt;/p&gt;

&lt;p&gt;🔹In this situation first memory creates and assign the value 10.&lt;/p&gt;

&lt;p&gt;🔹Next the reassign value 12 is not assigned the memory of value 10.&lt;/p&gt;

&lt;p&gt;🔹It creates a new memory and stores that value.&lt;/p&gt;

&lt;p&gt;◾Storage:Stores by values in the stack.&lt;/p&gt;

&lt;p&gt;🔹Every value stored by stack order&lt;br&gt;
line by line.&lt;/p&gt;

&lt;p&gt;🔹First value stored and then second value stored above the first value.&lt;/p&gt;

&lt;p&gt;◾ Comparison:Compared by actual value.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&lt;br&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%2Fc1d1j6ujxk086dchrjs0.jpg" 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%2Fc1d1j6ujxk086dchrjs0.jpg" alt=" " width="720" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fgflacjkun2dmvdh8rzmb.jpg" 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%2Fgflacjkun2dmvdh8rzmb.jpg" alt=" " width="720" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹It's compared by values (i(10)==j (10))&lt;br&gt;
Prints true.&lt;/p&gt;

&lt;p&gt;◾Methods:Do not have any methods but use the wrappers.&lt;/p&gt;

&lt;p&gt;◾Starts with a lowercase.&lt;/p&gt;
&lt;h2&gt;
  
  
  Non Primitive Data types:
&lt;/h2&gt;

&lt;p&gt;◾Mutable:Values can be changed or modified.&lt;/p&gt;

&lt;p&gt;◾Storing:Storing by the heap.&lt;/p&gt;

&lt;p&gt;🔹Does not follow the any order store a heap order.&lt;/p&gt;

&lt;p&gt;◾Comparison:Compared by memory reference or address.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fnzoc1e3tcjxtsci7l3c8.jpg" 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%2Fnzoc1e3tcjxtsci7l3c8.jpg" alt=" " width="720" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹In this program the array values i = [10] and j = [10] is have the same value 10.&lt;/p&gt;

&lt;p&gt;🔹But [10] = [10] are not take the value, it takes the memory address of the value.&lt;/p&gt;

&lt;p&gt;🔹So it's returns the false.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Ff0vvlhhqpz2m8hjept2p.jpg" 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%2Ff0vvlhhqpz2m8hjept2p.jpg" alt=" " width="720" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;◾Can have the methods and properties.&lt;/p&gt;

&lt;p&gt;◾ It's only starts with a uppercase.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Variables:
&lt;/h2&gt;

&lt;p&gt;◾Variables is a data containers&lt;/p&gt;

&lt;p&gt;◾Variables are used to store data values.&lt;/p&gt;

&lt;p&gt;◾The variables can be stored 4 different ways how the values should behave.&lt;/p&gt;

&lt;p&gt;◾Older Javascript:&lt;br&gt;
  🔹Using &lt;code&gt;var&lt;/code&gt;&lt;br&gt;
  🔹Automatically&lt;br&gt;
(Both are not recommended)&lt;/p&gt;

&lt;p&gt;◾Modern Javascript:&lt;br&gt;
  🔹Using &lt;code&gt;let&lt;/code&gt;&lt;br&gt;
  🔹Using &lt;code&gt;const&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using the let:&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%2Fq5sj0e8tl9s7mijnhxas.jpg" 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%2Fq5sj0e8tl9s7mijnhxas.jpg" alt=" " width="720" height="284"&gt;&lt;/a&gt;&lt;br&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%2F40u79p93bbw8b36t0k6l.jpg" 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%2F40u79p93bbw8b36t0k6l.jpg" alt=" " width="720" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹i contains the value 5&lt;br&gt;
🔹j contains the value 6&lt;br&gt;
🔹k adds the i and j stores the value 11.&lt;/p&gt;

&lt;p&gt;Using the const:&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%2Fhyrkeknd1oc3z0sztvkg.jpg" 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%2Fhyrkeknd1oc3z0sztvkg.jpg" alt=" " width="720" height="253"&gt;&lt;/a&gt;&lt;br&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%2Fzu6xeqhhwtn7bratd607.jpg" 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%2Fzu6xeqhhwtn7bratd607.jpg" alt=" " width="720" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹i contains the value 7&lt;br&gt;
🔹j contains the value 3&lt;br&gt;
🔹k adds the i and j stores the value 10.&lt;/p&gt;

&lt;p&gt;JAVASCRIPT IDENTIFIERS:&lt;/p&gt;

&lt;p&gt;◾ Variables are identified with unique names called identifiers.&lt;/p&gt;

&lt;p&gt;◾The rules for creating a name are:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🔹Names can contain letters, digits, underscores, and dollar signs.

🔹Names must begin with a letter, a $ sign or an underscore (_).

🔹Names are case sensitive ,because capital X is different from small x.

🔹Reserved  JavaScript  keywords like `const`, `let` `import`,`export` cannot be used as names.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Javascript Underscore(_):&lt;/p&gt;

&lt;p&gt;◾The underscore is treated as a letter in JavaScript names.&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%2Fsjv1urlgot0joprdx86b.jpg" 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%2Fsjv1urlgot0joprdx86b.jpg" alt=" " width="720" height="278"&gt;&lt;/a&gt;&lt;br&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%2F94oo2fus68yl28235ryk.jpg" 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%2F94oo2fus68yl28235ryk.jpg" alt=" " width="720" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Javascript Dollor sign $:&lt;/p&gt;

&lt;p&gt;◾The Dollor sign also treated as a letter in JavaScript names.&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%2Fm29fkvi0m26jjl1m15he.jpg" 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%2Fm29fkvi0m26jjl1m15he.jpg" alt=" " width="720" height="266"&gt;&lt;/a&gt;&lt;br&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%2Fgwca3w6l30h99p4wk5ls.jpg" 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%2Fgwca3w6l30h99p4wk5ls.jpg" alt=" " width="720" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DECLARING A JAVASCRIPT VARIABLES:&lt;/p&gt;

&lt;p&gt;◾Creating a variable in JavaScript is called declaring a variable.&lt;/p&gt;

&lt;p&gt;◾Using &lt;code&gt;let&lt;/code&gt; and  &lt;code&gt;const&lt;/code&gt; keywords to declare a variable in javascript.&lt;/p&gt;

&lt;p&gt;Declaring a Variable Using let:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Phonename = "Realme";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹After the declaration, you'll not assign the value it is &lt;code&gt;undefined&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🔹assign a value to a variable using equal = (assignment operator)&lt;/p&gt;

&lt;p&gt;🔹It's better to assign the value while you declared a variable.&lt;/p&gt;

&lt;p&gt;Declaring a Variable Using const:&lt;/p&gt;

&lt;p&gt;◾Always use &lt;code&gt;const&lt;/code&gt; if the value should not be changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Phonename = "Realme";``
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When to Use var, let, or const?&lt;/p&gt;

&lt;p&gt;◾Always declare a variables&lt;/p&gt;

&lt;p&gt;◾Always use &lt;code&gt;const&lt;/code&gt;, if the value should not be changed.&lt;/p&gt;

&lt;p&gt;◾Only use&lt;code&gt;let&lt;/code&gt;if you cannot use const.&lt;/p&gt;

&lt;p&gt;◾Never used &lt;code&gt;var&lt;/code&gt;and declare variable automatically.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
      <category>writing</category>
    </item>
    <item>
      <title>Details About the Basic Array Methods</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Wed, 08 Apr 2026 15:01:20 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/details-about-the-basic-array-methods-3b6i</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/details-about-the-basic-array-methods-3b6i</guid>
      <description>&lt;p&gt;In the previous blog I was post the basic array methods.In this blog discuss the detail about the array methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Array length:
&lt;/h2&gt;

&lt;p&gt;◾The &lt;code&gt;length&lt;/code&gt; method returns the count or size of an array.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fus3mpci1bbbtocchydb2.jpg" 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%2Fus3mpci1bbbtocchydb2.jpg" alt=" " width="720" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹In the array have 5 elements,so its returns the length 5.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F9e9j81zp0vmir4iasof6.jpg" 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%2F9e9j81zp0vmir4iasof6.jpg" alt=" " width="720" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;tostring()&lt;/code&gt;method returns the elements of an array to a separated string with a comma.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2F2zd8nz8nycmq8wde9jyy.jpg" 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%2F2zd8nz8nycmq8wde9jyy.jpg" alt=" " width="720" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹This method converts a every single Mobilebrand into an one single array seperate a comma.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fqu46wkj8jct1hmjwmfgt.jpg" 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%2Fqu46wkj8jct1hmjwmfgt.jpg" alt=" " width="720" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;EXAMPLE:&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%2Fs1zy5ef6gncxeb12xfmr.jpg" 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%2Fs1zy5ef6gncxeb12xfmr.jpg" alt=" " width="720" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹 Mobilebrand.at(3) returns a indexed element 3 'samsung'.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F7pjqtiko1tp8hd4c753g.jpg" 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%2F7pjqtiko1tp8hd4c753g.jpg" alt=" " width="720" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾This acts like a tostring().&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2F4k7581ok1fd5qmr5cqq3.jpg" 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%2F4k7581ok1fd5qmr5cqq3.jpg" alt=" " width="720" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹In this join() method we give a (+),so its create a array into a string joins with inbetween (+) element.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F7aj9k3248g9yuvek3p2p.jpg" 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%2F7aj9k3248g9yuvek3p2p.jpg" alt=" " width="720" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;EXAMPLE:&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%2F97sharo8ldjamscxityk.jpg" 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%2F97sharo8ldjamscxityk.jpg" alt=" " width="720" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹pop() method removes the end element 'nothing' frome the array.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F4u560n5eqgq13r3unq7r.jpg" 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%2F4u560n5eqgq13r3unq7r.jpg" alt=" " width="720" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;push()&lt;/code&gt; method adds a new element in the end of an array.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fraipeff24k0vd8zzvio3.jpg" 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%2Fraipeff24k0vd8zzvio3.jpg" alt=" " width="720" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹push() method adds a 'vivo' end of the array.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fbmozx9gnrn53r8cjdy5x.jpg" 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%2Fbmozx9gnrn53r8cjdy5x.jpg" alt=" " width="720" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;EXAMPLE:&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%2F7qtqaq871tjcqk1z5tq4.jpg" 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%2F7qtqaq871tjcqk1z5tq4.jpg" alt=" " width="720" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Shift() method removes first element 'realme'.&lt;/p&gt;

&lt;p&gt;🔹The balance elements shifts the place of removed element.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fiw2arktr2qaa9qxw3t9d.jpg" 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%2Fiw2arktr2qaa9qxw3t9d.jpg" alt=" " width="720" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;unshift()&lt;/code&gt; method adds a new element in the beginning of an array and the other elements unshifts the older elements.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2F1o6p8j7q78vwpwfch8us.jpg" 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%2F1o6p8j7q78vwpwfch8us.jpg" alt=" " width="720" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹'oneplus' added to the beginning of the array.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fzrrox4hbxk4e1yhiq2a0.jpg" 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%2Fzrrox4hbxk4e1yhiq2a0.jpg" alt=" " width="720" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;Array.isArray()&lt;/code&gt;used to finds array is really a array to returns a true.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fgqjx5dh88kvy77djxh8e.jpg" 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%2Fgqjx5dh88kvy77djxh8e.jpg" alt=" " width="720" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Mobilebrand is array,so its returns a true.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F3nf3rpmsom91cnhbbovz.jpg" 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%2F3nf3rpmsom91cnhbbovz.jpg" alt=" " width="720" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Array delete()
&lt;/h2&gt;

&lt;p&gt;◾&lt;code&gt;delete()&lt;/code&gt;method returns a undefined.&lt;/p&gt;

&lt;p&gt;◾Use the push and pop method instead of delete.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fibn4zojl0vbqxhwtwrql.jpg" 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%2Fibn4zojl0vbqxhwtwrql.jpg" alt=" " width="720" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Mobilebrand[1] defines undefined.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fr6qzxk6lwy2sjf5lh0xl.jpg" 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%2Fr6qzxk6lwy2sjf5lh0xl.jpg" alt=" " width="720" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;concat()&lt;/code&gt; method creates a new array to merging the existing arrays.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fupxhchimyrkldfb2re3t.jpg" 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%2Fupxhchimyrkldfb2re3t.jpg" alt=" " width="720" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Concat merge the GroupB array to existing array GroupA to in a single array.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fbmmbjfjrdjkrcnrrj5aw.jpg" 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%2Fbmmbjfjrdjkrcnrrj5aw.jpg" alt=" " width="720" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Array copy Within()
&lt;/h2&gt;

&lt;p&gt;◾The &lt;code&gt;copy Within()&lt;/code&gt; method copies array elements to another position in an array.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fthm5u62ltxqu2mvko6y1.jpg" 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%2Fthm5u62ltxqu2mvko6y1.jpg" alt=" " width="720" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fdy304i7rd95i9zgtqhis.jpg" 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%2Fdy304i7rd95i9zgtqhis.jpg" alt=" " width="720" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;◾The &lt;code&gt;flat()&lt;/code&gt; method creates a new array and merge with sub-array.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fk57x87g9g1huocopvs45.jpg" 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%2Fk57x87g9g1huocopvs45.jpg" alt=" " width="720" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹flat method Merge the sub arrays with array&lt;br&gt;
groups.&lt;/p&gt;

&lt;p&gt;🔹Merge the sub array numbers in one array.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fl0ogkz3fauegsrea341u.jpg" 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%2Fl0ogkz3fauegsrea341u.jpg" alt=" " width="720" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;EXAMPLE 1:&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%2Fzb1ss8d0kpe4i9zniz3n.jpg" 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%2Fzb1ss8d0kpe4i9zniz3n.jpg" alt=" " width="720" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT 1:&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%2Fn0x6ar8ra7ug9hjq784k.jpg" 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%2Fn0x6ar8ra7ug9hjq784k.jpg" alt=" " width="720" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;🔹dc and srh added index 2&lt;/p&gt;

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

&lt;p&gt;🔹Second value is 0 no value has been removed.&lt;/p&gt;

&lt;p&gt;EXAMPLE 2:&lt;br&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%2Fucdzrxvws188qcnnw4rd.jpg" 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%2Fucdzrxvws188qcnnw4rd.jpg" alt=" " width="720" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;🔹dc and srh added index 2&lt;/p&gt;

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

&lt;p&gt;🔹Second value is 1,so 'rcb' has been removed.&lt;/p&gt;

&lt;p&gt;OUTPUT 2:&lt;br&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%2Fksp25aed20qtng3xtk5t.jpg" 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%2Fksp25aed20qtng3xtk5t.jpg" alt=" " width="720" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Array Slice()
&lt;/h2&gt;

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

&lt;p&gt;EXAMPLE:&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%2Fa68pjsx632wrp90hgpyk.jpg" 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%2Fa68pjsx632wrp90hgpyk.jpg" alt=" " width="720" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Slice out a part of an array starting from array element 1 ("csk")&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F3rflsirbljm3qhdsm112.jpg" 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%2F3rflsirbljm3qhdsm112.jpg" alt=" " width="720" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Array to Spliced()
&lt;/h2&gt;

&lt;p&gt;◾It also removes the element from the array.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2F9458dhvxcmewym0boizp.jpg" 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%2F9458dhvxcmewym0boizp.jpg" alt=" " width="720" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹'0' defines the index and '2' defines the two elements.&lt;/p&gt;

&lt;p&gt;🔹Elements removed starting from the index 0 to two elements.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fy6q5fjp5dvzmq4itdw91.jpg" 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%2Fy6q5fjp5dvzmq4itdw91.jpg" alt=" " width="720" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
      <category>writing</category>
    </item>
    <item>
      <title>Discuss about the topics of 1.Constructor Function 2.Return Statement in Javascript 3.Bacis Array Methods</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Tue, 07 Apr 2026 14:29:15 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/discuss-about-the-topics-of-1constructor-function-2return-l13</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/discuss-about-the-topics-of-1constructor-function-2return-l13</guid>
      <description>&lt;h2&gt;
  
  
  Constructor Function:
&lt;/h2&gt;

&lt;p&gt;◾Constructor function is used to create and initialize multiple objects of the same type.&lt;/p&gt;

&lt;p&gt;◾It overcomes the difficulty of multiline code, construct a single line.&lt;/p&gt;

&lt;p&gt;◾Constructor must be called with the &lt;code&gt;new&lt;/code&gt;operator.&lt;/p&gt;

&lt;p&gt;Const phone1 ={&lt;br&gt;
     brand:"Nothing",&lt;br&gt;
     model:"cmf phone 2pro",&lt;br&gt;
     price:20000&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Const phone2 = {&lt;br&gt;
     brand:"Realme",&lt;br&gt;
     model:"P4 pro",&lt;br&gt;
     price:22000&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;✓ It's a normal object creation for phone details.&lt;/p&gt;

&lt;p&gt;✓ This method enough with two or three phone details.&lt;/p&gt;

&lt;p&gt;✓ What if, can write the details of all realme brand mobiles,so overcome this difficult use a contructor function to construct a code in single line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&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%2Fjwzjv1nxenwqnnabjj39.jpg" 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%2Fjwzjv1nxenwqnnabjj39.jpg" alt=" " width="701" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EXPLANATION:&lt;/p&gt;

&lt;p&gt;🔹Create a function to give the parameters(Nothing","cmf phone 2pro",20000) of you write.&lt;/p&gt;

&lt;p&gt;🔹Then to sets a this operation to call a properties and methods.&lt;/p&gt;

&lt;p&gt;🔹This multiline code&lt;br&gt;
       brand:"Nothing",&lt;br&gt;
       model:"cmf phone 2pro",&lt;br&gt;
       price:20000 &lt;br&gt;
   Written a single line code of&lt;br&gt;
       const phone 1 = new phone("nothing", "cmf phone 2pro", 20000);&lt;/p&gt;

&lt;p&gt;🔹Writing, const phone2 = new phone("realme", "p4 pro" 22000);&lt;br&gt;
instead of this code&lt;br&gt;
       brand:"Realme",&lt;br&gt;
       model:"P4 pro",&lt;br&gt;
       price:22000&lt;/p&gt;

&lt;p&gt;🔹Use the &lt;code&gt;new&lt;/code&gt;keyword,when you use the new keyword javascript performs the above steps.&lt;/p&gt;

&lt;p&gt;🔹Use the this to Print the code like (this.brand, this.model, this .price);&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fc0lvxalcwtfd8kgf6y8q.jpg" 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%2Fc0lvxalcwtfd8kgf6y8q.jpg" alt=" " width="700" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Return Statement in Javascript:
&lt;/h2&gt;

&lt;p&gt;◾The return statement is used to end function execution and a value to be sent back to the caller.&lt;/p&gt;

&lt;p&gt;◾The caller used that value at any time.&lt;/p&gt;

&lt;p&gt;◾If the caller don't return the value the value won't used to be any variable.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&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%2Fbgwzh57it61cedn0wokn.jpg" 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%2Fbgwzh57it61cedn0wokn.jpg" alt=" " width="720" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔹Create a function named add(a,b)&lt;/p&gt;

&lt;p&gt;🔹Return the  parameters a and b.&lt;/p&gt;

&lt;p&gt;🔹Create a new variable to store the function name and give the values of parameters.&lt;/p&gt;

&lt;p&gt;🔹Then print the code.&lt;/p&gt;

&lt;p&gt;🔹The sum output 15 is return to the caller function add.&lt;/p&gt;

&lt;p&gt;🔹The value can be used at any variable,if not the give the return statement the value won't be used at any variable.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F9ny2o7xjp2jne5wl0inm.jpg" 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%2F9ny2o7xjp2jne5wl0inm.jpg" alt=" " width="720" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Returning value of some data types:
&lt;/h2&gt;

&lt;p&gt;Undefined:&lt;br&gt;
Returned for variables declared but not yet assigned a value.&lt;/p&gt;

&lt;p&gt;Boolean:&lt;br&gt;
Returned for true and false.&lt;/p&gt;

&lt;p&gt;Number:&lt;br&gt;
Returned integers(1,2,3), floats(3.1,2.13), and special values like NaN and Infinity.&lt;/p&gt;

&lt;p&gt;BigInt:&lt;br&gt;
Used for larger integers like 123456.&lt;/p&gt;

&lt;p&gt;String:Returned for all textual data with a double quotation like ("javascript","Deva","123")&lt;/p&gt;

&lt;p&gt;Object:Returned for objects {} and arrays [].&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Array Methods:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Array length

Array isArray)

Array toString()

Array delete()

Array at()

Array concat()

Array Join()

Array copy Within()

Array pop()

Array flat()

Array push()

Array slice()

Array shift()

Array splice()

Array unshift()

Array to Spliced()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(To be discussed )&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Objects in Javascript</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Mon, 06 Apr 2026 13:55:42 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/objects-in-javascript-3h0i</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/objects-in-javascript-3h0i</guid>
      <description>&lt;h2&gt;
  
  
  Definition of Objects:
&lt;/h2&gt;

&lt;p&gt;◾Object in simple words it's a real world entity.&lt;/p&gt;

&lt;p&gt;◾An object is a dynamic data structure that stores data as key-value pairs, where each key uniquely identifies its value.&lt;/p&gt;

&lt;p&gt;◾Objects are mutable and dynamic properties can be added, modified, or deleted at any time.&lt;/p&gt;

&lt;p&gt;◾Object is enclosed with curley braces{}.&lt;/p&gt;

&lt;p&gt;◾Objects contains properties and methods.&lt;/p&gt;

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

&lt;p&gt;Const object name(){&lt;br&gt;
    properties(key-pairs)&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  CRUD Operation of Object:
&lt;/h2&gt;

&lt;p&gt;C - Create&lt;br&gt;
R - Read&lt;br&gt;
U - Update&lt;br&gt;
D - Delete&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the Object:
&lt;/h2&gt;

&lt;p&gt;▪️Create a new object or add new keys the existing object.&lt;/p&gt;

&lt;p&gt;EXAMPLE PROGRAM:&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%2Fom325btrnx2smkk4piy8.jpg" 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%2Fom325btrnx2smkk4piy8.jpg" alt=" " width="720" height="436"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;1.Const is a syntax notation of object.&lt;/p&gt;

&lt;p&gt;2.phone is the object&lt;/p&gt;

&lt;p&gt;3.The information of inside the curley braces called properties.&lt;/p&gt;

&lt;p&gt;4.In the properties left side of the colon(:) is called keys and the next to right side of the colon(:) called values.&lt;/p&gt;

&lt;p&gt;5.console.log(phone.price)&lt;br&gt;
   Phone - object name&lt;br&gt;
   Price - key name&lt;br&gt;
   (.)  - dot operator.It's used to seperate the object name and key name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read in objects:
&lt;/h2&gt;

&lt;p&gt;▪️Read or print the values using keys&lt;/p&gt;

&lt;p&gt;EXAMPLE PROGRAM:&lt;br&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%2Fwjelalt43d86ch5lccc7.jpg" 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%2Fwjelalt43d86ch5lccc7.jpg" alt=" " width="720" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.In the above program was read and print the existing data of objects using the keywords.&lt;/p&gt;

&lt;p&gt;2.brand prints their value oneplus.&lt;br&gt;
price prints:25000 &lt;br&gt;
color prints:navy blue&lt;br&gt;
Processor prints: Snapdragon 7 gen3&lt;br&gt;
Model prints:Nord CE5.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F73coe1hvcrkkcvn75q5o.jpg" 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%2F73coe1hvcrkkcvn75q5o.jpg" alt=" " width="720" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Update in objects:
&lt;/h2&gt;

&lt;p&gt;▪️Update the new value instead of existing value.&lt;/p&gt;

&lt;p&gt;EXAMPLE PROGRAM:&lt;br&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%2Fv9of2v0bfy7madbihctx.jpg" 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%2Fv9of2v0bfy7madbihctx.jpg" alt=" " width="720" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.Update the new value,&lt;br&gt;
   phone.price = 28000&lt;br&gt;
   phone.color = "Marble mist"&lt;br&gt;
   phone.processor = "Mediatek dimensity 8350 Apex " instead of existing values.&lt;/p&gt;

&lt;p&gt;2.If you want rearrange the values, using object name and keyword.&lt;/p&gt;

&lt;p&gt;3.It takes the value of last rearranged value.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F5j7vjr56kbq3gdwj45gu.jpg" 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%2F5j7vjr56kbq3gdwj45gu.jpg" alt=" " width="720" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Delete in objects:
&lt;/h2&gt;

&lt;p&gt;▪️Delete the property and its value from the objects.&lt;/p&gt;

&lt;p&gt;EXAMPLE PROGRAM:&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%2F84okbdbr89bwu8y7yruc.jpg" 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%2F84okbdbr89bwu8y7yruc.jpg" alt=" " width="720" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.Using delete operator to remove the phone color and processor.&lt;/p&gt;

&lt;p&gt;2.If the property was successfully removed it returns &lt;code&gt;true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2F2irmi5v1la9xjbq7pk39.jpg" 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%2F2irmi5v1la9xjbq7pk39.jpg" alt=" " width="720" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Function in Javascript</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Mon, 06 Apr 2026 05:34:59 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/function-in-javascript-3me0</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/function-in-javascript-3me0</guid>
      <description>&lt;h2&gt;
  
  
  Definition of Function:
&lt;/h2&gt;

&lt;p&gt;✓ Some activity or set of instructions with name called function.&lt;/p&gt;

&lt;p&gt;✓ In JavaScript, a function is a reusable block of code designed to perform a specific task. Functions are executed when they are "invoked" or called.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Function Declaration:
&lt;/h2&gt;

&lt;p&gt;✓ Most common way to define a function using the function keyword.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&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%2Fbikrefxgp2rx6v8rh6d9.jpg" 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%2Fbikrefxgp2rx6v8rh6d9.jpg" alt=" " width="714" height="511"&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%2Fpdi4sqpmi6y7ld2xn7og.jpg" 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%2Fpdi4sqpmi6y7ld2xn7og.jpg" alt=" " width="720" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Parameters: name is a placeholder for the value you pass into the function.&lt;/p&gt;

&lt;p&gt;Arguments: "Deva" is the actual value (argument) passed during the call.&lt;/p&gt;

&lt;p&gt;Return Statement: The return keyword stops function execution and sends a value back to the caller.&lt;/p&gt;

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

&lt;p&gt;A function can also be defined inside an expression and assigned to a variable.&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%2Ffulzv0kx7efr5clojy4e.jpg" 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%2Ffulzv0kx7efr5clojy4e.jpg" alt=" " width="720" height="353"&gt;&lt;/a&gt;&lt;br&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%2Fi4y9gk6flt34mbcw2eoi.jpg" 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%2Fi4y9gk6flt34mbcw2eoi.jpg" alt=" " width="720" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Concepts:
&lt;/h2&gt;

&lt;p&gt;Reusability: You can call the same function multiple times with different arguments to get different results.&lt;/p&gt;

&lt;p&gt;Scope: Variables defined inside a function are "local" and cannot be accessed from outside that function.&lt;/p&gt;

&lt;p&gt;Anonymous Functions: These are functions without a name, often used as "callbacks" (functions passed as arguments to other functions).       &lt;/p&gt;

&lt;p&gt;Built-in Functions: JavaScript includes pre-defined functions that you can use immediately like console.log(), alert(), and Math.sqrt().     (To be discussed)&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>tutorial</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>In Array Program Using Any Student Marks To Find: 1.Fail Count. 2.Total Marks. 3.Average. 4.If the student fails Print "No grade" or Pass print "Grade".</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Thu, 02 Apr 2026 15:09:29 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/in-array-program-using-any-student-marks-to-find-1fail-count-2total-marks-3average-4if-the-18j8</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/in-array-program-using-any-student-marks-to-find-1fail-count-2total-marks-3average-4if-the-18j8</guid>
      <description>&lt;p&gt;1.Fail Count. &lt;br&gt;
2.Total Marks.&lt;br&gt;
3.Average.&lt;br&gt;
4.If the student fails Print "No grade" or Pass print "Grade" based on Average.&lt;/p&gt;

&lt;p&gt;1)PROGRAM:&lt;br&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%2F4oqz8c2nzyqbsl2y2rac.jpg" 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%2F4oqz8c2nzyqbsl2y2rac.jpg" alt=" " width="720" height="998"&gt;&lt;/a&gt;&lt;br&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%2Fdugjnkjwaq45t73s2iq8.jpg" 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%2Fdugjnkjwaq45t73s2iq8.jpg" alt=" " width="718" height="727"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;STEPS:&lt;/p&gt;

&lt;p&gt;Step 1: Declare a marks in an array.Notation is const marks[marks]&lt;/p&gt;

&lt;p&gt;Step 2:We wanna fail count,total, and average.so declare a global variable named let.we don't know about the fail count,total and average so, declare let fail=0,total=0,average=0.&lt;/p&gt;

&lt;p&gt;Step 3: Then declare i=0.because the first element of array is index 0.&lt;/p&gt;

&lt;p&gt;Step 4:Next write the while loop(i&amp;lt;5). because the array have five elements and index starting 0 to 4.&lt;/p&gt;

&lt;p&gt;Step 5:Then declare the if(marks[i]&amp;lt;35)&lt;/p&gt;

&lt;p&gt;Step 6:If the condition is true increase the fail count.&lt;/p&gt;

&lt;p&gt;Step 7: Increment the value of i&lt;/p&gt;

&lt;p&gt;Step 8:Print the fail count out of the while loop.&lt;/p&gt;

&lt;p&gt;Step 9:Then again open the If statement to give (fail&amp;gt;0).&lt;/p&gt;

&lt;p&gt;Step 10:If the condition is true,print No grade.&lt;/p&gt;

&lt;p&gt;Step 11:Else again declare i=0.because in the previous we declared i, is fails and breaks the while loop because i=5 is (i&amp;lt;5).false.Now i value is 5.so again redeclare i or give another variable names like j,k.&lt;/p&gt;

&lt;p&gt;Step 12:Write a new while loop give condition of while(i&amp;lt;5)&lt;/p&gt;

&lt;p&gt;Step 13:Then give total = total + marks[i].&lt;/p&gt;

&lt;p&gt;Step 14:Next increment the value of i.&lt;/p&gt;

&lt;p&gt;Step 15:Out of while loop print total.&lt;/p&gt;

&lt;p&gt;Step 16:Then find average.so give average= total/5.because we have 5 variables.&lt;/p&gt;

&lt;p&gt;Step 17:Then write if condition student have no fail count if (fail==0).&lt;/p&gt;

&lt;p&gt;Step 18:if (average &amp;gt;=90)&lt;br&gt;
         Print Grade A&lt;/p&gt;

&lt;p&gt;Step 19: else if (average &amp;gt;80 &amp;amp;&amp;amp; average &amp;lt; 90)&lt;br&gt;
         Print Grade B&lt;/p&gt;

&lt;p&gt;Step 20: else if (average &amp;gt;70 &amp;amp;&amp;amp; average &amp;lt; 80)&lt;br&gt;
         Print Grade C&lt;/p&gt;

&lt;p&gt;Step 21:else if (average &amp;gt;50 &amp;amp;&amp;amp; average &amp;lt; 70)&lt;br&gt;
         Print Grade D&lt;/p&gt;

&lt;p&gt;Step 22:else &lt;br&gt;
         Print Grade E&lt;/p&gt;

&lt;p&gt;WORKING:&lt;/p&gt;

&lt;p&gt;1.We wanna fail count so declare fail count is 0.&lt;/p&gt;

&lt;p&gt;2.Then check the while condition:&lt;br&gt;
i = 0&lt;br&gt;
While(0&amp;lt;5).True&lt;br&gt;
i = 1&lt;br&gt;
While(1&amp;lt;5).True&lt;br&gt;
i = 2&lt;br&gt;
While(2&amp;lt;5).True&lt;br&gt;
i = 3&lt;br&gt;
While(3&amp;lt;5).True&lt;br&gt;
i = 4&lt;br&gt;
While(4&amp;lt;5).True&lt;br&gt;
i = 5&lt;br&gt;
While(5&amp;lt;5).false.loop stop&lt;/p&gt;

&lt;p&gt;3.Next check the if condition:&lt;/p&gt;

&lt;p&gt;Index 0=80&lt;br&gt;
if(marks[80]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 1=98&lt;br&gt;
if(marks[98]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 2=89&lt;br&gt;
if(marks[89]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 3=33&lt;br&gt;
if(marks[33]&amp;lt;35).true&lt;/p&gt;

&lt;p&gt;Index 4=100&lt;br&gt;
if(marks[100]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;4.If the condition is true fail count is increase.In the above condition index 0.1,2,4 is false. so fail count not increase.Index 3 is true,then fail count increase.Fail count is 1.&lt;/p&gt;

&lt;p&gt;5.Finally when the while loop fails it prints the fail count.&lt;/p&gt;

&lt;p&gt;6.Next fail count is &amp;gt; 0,Print No grade.(fail&amp;gt;0)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ◾ Fail is 1&amp;gt; 0.true
  So,in this program not runs else part.print No grade. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;7.If the above if condition is fails the else part will runs.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fo967jfeanrug2spjw1ay.jpg" 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%2Fo967jfeanrug2spjw1ay.jpg" alt=" " width="720" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2)PROGRAM:&lt;br&gt;
✓ In this program little vary from above program. one array value is changed. Index 3 value 89 changed instead of 33.&lt;/p&gt;

&lt;p&gt;✓ Otherwise same steps like above program.&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%2F5ms9hzkxhgna9rapugt7.jpg" 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%2F5ms9hzkxhgna9rapugt7.jpg" alt=" " width="720" height="998"&gt;&lt;/a&gt;&lt;br&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%2Fxgxsrlwz3sjj7r2sxwpd.jpg" 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%2Fxgxsrlwz3sjj7r2sxwpd.jpg" alt=" " width="720" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WORKING:&lt;br&gt;
1.Same working like above program in the No grade step.In this program fail count is 0.So the else part runs.&lt;/p&gt;

&lt;p&gt;2.If the above if condition is fails so the else part runs.so create new while loop and give&lt;br&gt;
  i = 0 and then while (i&amp;lt;5) &lt;/p&gt;

&lt;p&gt;3.Find total,so total = total + marks[i].&lt;/p&gt;

&lt;p&gt;◾ Total=0+80 =80.total is 80&lt;/p&gt;

&lt;p&gt;◾ Total=80+98 =178.total is 178&lt;/p&gt;

&lt;p&gt;◾ Total=178+89 =267.total is 267&lt;/p&gt;

&lt;p&gt;◾ Total=267+86 =353.total is 353&lt;/p&gt;

&lt;p&gt;◾ Total=353+100 =453.&lt;br&gt;
     total is 453.&lt;/p&gt;

&lt;p&gt;4.Increment the value of i&lt;/p&gt;

&lt;p&gt;5.Then print total.&lt;/p&gt;

&lt;p&gt;6.Next find average using Math.floor it's give first value of quotient.So give average = Math.floor(total/5)&lt;/p&gt;

&lt;p&gt;◾Average = 453/5=90.6&lt;br&gt;
     We use Math.floor,so the average is 90.&lt;/p&gt;

&lt;p&gt;8.if (fail == 0).fail count&lt;br&gt;
 is 0.true&lt;/p&gt;

&lt;p&gt;7.The average is (average &amp;gt;= 90).&lt;br&gt;
  (90 = 90)&lt;/p&gt;

&lt;p&gt;8.So, print the grade A.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F9flmgmobaq90ba4qbp9f.jpg" 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%2F9flmgmobaq90ba4qbp9f.jpg" alt=" " width="720" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Basic About Array in Javascript and Some Examples</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Thu, 02 Apr 2026 09:45:08 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/basic-about-array-in-javascript-and-some-examples-fe5</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/basic-about-array-in-javascript-and-some-examples-fe5</guid>
      <description>&lt;p&gt;DEFINITION OF ARRAY:&lt;/p&gt;

&lt;p&gt;Array is an ordered collection of values that can store multiple data types under a single variable name.&lt;/p&gt;

&lt;p&gt;CHARACTERISTICS OF ARRAY:&lt;/p&gt;

&lt;p&gt;◾Zero Indexed:&lt;br&gt;
     In the array the first element is always at index 0 and the second at 1,and so on.&lt;/p&gt;

&lt;p&gt;◾Dynamic Sizing: &lt;br&gt;
    In Arrays  automatically as you add or remove elements.&lt;/p&gt;

&lt;p&gt;◾Heterogeneous: &lt;br&gt;
    A single array can hold a mix of different types, such as numbers, strings, and even other arrays.&lt;/p&gt;

&lt;p&gt;CREATING AND WORKING OF ARRAY:&lt;/p&gt;

&lt;p&gt;Creation: Use the common Array Literal notation: const mobile brand = ["Apple", "Realme","Vivo"];&lt;/p&gt;

&lt;p&gt;Working: Use bracket notation: mobile brand [0] returns "Apple".&lt;br&gt;
mobile brand [1] returns "Realme".&lt;br&gt;
mobile brand [2] returns "Vivo".&lt;/p&gt;

&lt;p&gt;FIND THE COUNT OF FAIL:&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2F72gnvwdt1xqqqw2hblwt.jpg" 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%2F72gnvwdt1xqqqw2hblwt.jpg" alt=" " width="718" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;STEPS:&lt;br&gt;
Step 1: Declare a marks in array.Notation is const marks[marks]&lt;/p&gt;

&lt;p&gt;Step 2:We wanna how many count the students fail.so declare a global variable named let.we don't know about the count so, declare let fail=0.&lt;/p&gt;

&lt;p&gt;Step 3: Then declare i=0.because the first element of array is index 0.&lt;/p&gt;

&lt;p&gt;Step 4:Next write the while loop(i&amp;lt;5). because the array have five elements and index starting 0 to 4.&lt;/p&gt;

&lt;p&gt;Step 5:Then declare the if(marks[i]&amp;lt;35)&lt;/p&gt;

&lt;p&gt;Step 6:If the condition is true increase the fail count.&lt;/p&gt;

&lt;p&gt;Step 7: Increment the i&lt;/p&gt;

&lt;p&gt;Step 8:Print the fail count.&lt;/p&gt;

&lt;p&gt;WORKING:&lt;br&gt;
1.We wanna fail count so declare fail count is 0.&lt;/p&gt;

&lt;p&gt;2.Then  check the while condition:&lt;br&gt;
  i = 0 &lt;br&gt;
  While(0&amp;lt;5).True&lt;br&gt;
  i = 1&lt;br&gt;
  While(1&amp;lt;5).True&lt;br&gt;
  i = 2&lt;br&gt;
  While(2&amp;lt;5).True&lt;br&gt;
  i = 3&lt;br&gt;
  While(3&amp;lt;5).True&lt;br&gt;
  i = 4 &lt;br&gt;
  While(4&amp;lt;5).True&lt;br&gt;
  i = 5&lt;br&gt;
  While(5&amp;lt;5).false.loop stop&lt;/p&gt;

&lt;p&gt;3.Next check the if condition:&lt;/p&gt;

&lt;p&gt;Index 0=80&lt;br&gt;
  if(marks[80]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 1=98&lt;br&gt;
  if(marks[98]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 2=89&lt;br&gt;
  if(marks[89]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 3=33&lt;br&gt;
  if(marks[33]&amp;lt;35).true&lt;/p&gt;

&lt;p&gt;Index 4=100&lt;br&gt;
  if(marks[100]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;4.If the condition is true fail count is increase.In the above condition index 0.1,2,4 is false. so fail count not increase.Index 3 is true,then fail count increase.Fail count is 1.&lt;/p&gt;

&lt;p&gt;5.Finally when the while loop fails it prints the fail count.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fawje477m372lnj1adupq.jpg" 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%2Fawje477m372lnj1adupq.jpg" alt=" " width="720" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FIND THE COUNT OF PASS AND FAIL:&lt;br&gt;
PROGRAM:&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%2F2ntxocsehr7vbyxv32zf.jpg" 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%2F2ntxocsehr7vbyxv32zf.jpg" alt=" " width="720" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;STEPS:&lt;/p&gt;

&lt;p&gt;Step 1: Declare a marks in array.Notation is const marks[marks]&lt;/p&gt;

&lt;p&gt;Step 2:We wanna how many count the students fail and pass count.so declare a global variable named let.we don't know about the count so, declare let fail=0 and pass=0.&lt;/p&gt;

&lt;p&gt;Step 3: Then declare i=0.because the first element of array is index 0.&lt;/p&gt;

&lt;p&gt;Step 4:Next write the while loop(i&amp;lt;5). because the array have five elements and index starting 0 to 4.&lt;/p&gt;

&lt;p&gt;Step 5:Then declare the if(marks[i]&amp;lt;35)&lt;/p&gt;

&lt;p&gt;Step 6:If the condition is true increase the fail count.&lt;/p&gt;

&lt;p&gt;Step 7:6:If the condition is false increase the pass count.&lt;/p&gt;

&lt;p&gt;Step 8: Increment the value of i&lt;/p&gt;

&lt;p&gt;Step 9:Print the fail count.&lt;/p&gt;

&lt;p&gt;WORKING:&lt;/p&gt;

&lt;p&gt;1.We wanna fail and pass count so declare fail and pass count is 0.&lt;/p&gt;

&lt;p&gt;2.Then  check the while condition:&lt;br&gt;
  i = 0 &lt;br&gt;
  While(0&amp;lt;5).True&lt;br&gt;
  i = 1&lt;br&gt;
  While(1&amp;lt;5).True&lt;br&gt;
  i = 2&lt;br&gt;
  While(2&amp;lt;5).True&lt;br&gt;
  i = 3&lt;br&gt;
  While(3&amp;lt;5).True&lt;br&gt;
  i = 4 &lt;br&gt;
  While(4&amp;lt;5).True&lt;br&gt;
  i = 5&lt;br&gt;
  While(5&amp;lt;5).false.loop stop&lt;/p&gt;

&lt;p&gt;3.Next check the if condition:&lt;br&gt;
  Index 0=80&lt;br&gt;
  if(marks[80]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 1=98&lt;br&gt;
  if(marks[98]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 2=89&lt;br&gt;
  if(marks[89]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;Index 3=33&lt;br&gt;
  if(marks[33]&amp;lt;35).true&lt;/p&gt;

&lt;p&gt;Index 4=100&lt;br&gt;
  if(marks[100]&amp;lt;35).false&lt;/p&gt;

&lt;p&gt;4.If the condition is true fail count is increase.In the above condition index 0.1,2,4 is false. so fail count not increase.Index 3 is true,then fail count increase.Fail count is 1.&lt;/p&gt;

&lt;p&gt;5.Then if condition is false increase pass count.Index 3 is true and except all marks are pass.so pass count is 4&lt;/p&gt;

&lt;p&gt;6.Finally when the while loop fails it prints the fail  and pass count.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fal3u94h598wnum4etkt6.jpg" 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%2Fal3u94h598wnum4etkt6.jpg" alt=" " width="716" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FIND THE TOTAL MARKS:&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2Fw5ummp8bypjxsade46ba.jpg" 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%2Fw5ummp8bypjxsade46ba.jpg" alt=" " width="720" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;STEPS:&lt;/p&gt;

&lt;p&gt;Step 1: Declare a marks in array.Notation is const marks[marks]&lt;/p&gt;

&lt;p&gt;Step 2:We wanna total of the student.marks.so declare a global variable named let.we don't know about the total so, declare let total=0.&lt;/p&gt;

&lt;p&gt;Step 3: Then declare i=0.because the first element of array is index 0.&lt;/p&gt;

&lt;p&gt;Step 4:Next write the while loop(i&amp;lt;5). because the array have five elements and index starting 0 to 4.&lt;/p&gt;

&lt;p&gt;Step 5:Then declare total= total+marks[i].&lt;/p&gt;

&lt;p&gt;Step 6: Increment the value of i&lt;/p&gt;

&lt;p&gt;Step 8:Print the total count.&lt;/p&gt;

&lt;p&gt;WORKING:&lt;br&gt;
1.We wanna total so declare total is 0.&lt;/p&gt;

&lt;p&gt;2.Then  check the while condition:&lt;br&gt;
  i = 0 &lt;br&gt;
  While(0&amp;lt;5).True&lt;br&gt;
  i = 1&lt;br&gt;
  While(1&amp;lt;5).True&lt;br&gt;
  i = 2&lt;br&gt;
  While(2&amp;lt;5).True&lt;br&gt;
  i = 3&lt;br&gt;
  While(3&amp;lt;5).True&lt;br&gt;
  i = 4 &lt;br&gt;
  While(4&amp;lt;5).True&lt;br&gt;
  i = 5&lt;br&gt;
  While(5&amp;lt;5).false.loop stop&lt;/p&gt;

&lt;p&gt;3.Then check the condition:&lt;br&gt;
  total= total+marks[i].&lt;br&gt;
  Total=0+80 =80.total is 80&lt;/p&gt;

&lt;p&gt;Total=80+98 =178.total is 178&lt;/p&gt;

&lt;p&gt;Total=178+89 =267.total is 267&lt;/p&gt;

&lt;p&gt;Total=267+33 =300.total is 300&lt;/p&gt;

&lt;p&gt;Total=300+100 =400.total is 400&lt;/p&gt;

&lt;p&gt;4.Increment the value of i.&lt;/p&gt;

&lt;p&gt;5.Then print the total marks 400.&lt;br&gt;
OUTPUT:&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%2Fn8nd32mmcn93182s2wvj.jpg" 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%2Fn8nd32mmcn93182s2wvj.jpg" alt=" " width="720" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>While loop Programs in Javascript: Reverse Printing a Number</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Tue, 31 Mar 2026 14:02:07 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/while-loop-programs-in-javascript-reverse-printing-a-number-2i8</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/while-loop-programs-in-javascript-reverse-printing-a-number-2i8</guid>
      <description>&lt;p&gt;REVERSE PRINTING A NUMBER:&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2F4v2thgff5ec28e809q8n.jpg" 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%2F4v2thgff5ec28e809q8n.jpg" alt=" " width="720" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EXPLANATION:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;assume 123.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;123%10 = remainder 3. 12% 10 = remainder 2. do, any number to divide by 10, you get he last digit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Condition (no &amp;gt; 0). because if you reverse The number, will end a last digit is 0, so take number &amp;gt; 0&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We Don't know the Count, so take remainder let rem = 0. rem is remainder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then take remainder = (rem* 10) + number % 10.Initial assigned rem value is 0.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;◾rem * 10 = 0 * 10 = 0 &lt;br&gt;
  no % 10 = 123 % 10= 3&lt;/p&gt;

&lt;p&gt;◾0+3=3&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Number= math. floor (number/10);
math floor means it give a initial quotient. example(123/10=12.3). It gives only first digit (or) round value 12.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;◾Then number = (123/10) = 12&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Then print The remainder.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;◾ rem= 3 &lt;br&gt;
     number= 12&lt;/p&gt;

&lt;p&gt;◾ 3 × 10 = 30&lt;br&gt;
    12% 10 = 2.          (30+2=32)&lt;/p&gt;

&lt;p&gt;◾ Then number = (12/10) = 1&lt;/p&gt;

&lt;p&gt;◾ Now rem= 32 &lt;br&gt;
     number = 1&lt;/p&gt;

&lt;p&gt;◾ rem * 10 32*10=320&lt;br&gt;
   no % 10 = 1 % 10 = 1.(320+1=321)                                         &lt;/p&gt;

&lt;p&gt;◾ Then number = (1/10) = 0&lt;/p&gt;

&lt;p&gt;◾ Then goto while loop(0&amp;gt;0) is  false.&lt;/p&gt;

&lt;p&gt;OUTPUT:&lt;br&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%2Fci8ek47gfwubdb19tgcs.jpg" 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%2Fci8ek47gfwubdb19tgcs.jpg" alt=" " width="720" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Prime Number in Looping Using JavaScript</title>
      <dc:creator>Deva I</dc:creator>
      <pubDate>Mon, 30 Mar 2026 13:19:43 +0000</pubDate>
      <link>https://forem.com/deva_i_932c8869ada96d4c9f/prime-number-in-looping-using-javascript-50e</link>
      <guid>https://forem.com/deva_i_932c8869ada96d4c9f/prime-number-in-looping-using-javascript-50e</guid>
      <description>&lt;p&gt;PRIME NUMBER:&lt;br&gt;
A number greater than 1 cannot be divided evenly by any number other than 1 and itself, it is called  prime number.&lt;/p&gt;

&lt;p&gt;FIND A GIVEN NUMBER IS PRIME NUMBER&lt;br&gt;
OR NOT:&lt;/p&gt;

&lt;p&gt;LOGIC:&lt;br&gt;
✓ If a number have only 2 count divisors is prime,On tha other hand a number have a more than 2 divisors not a prime number.&lt;/p&gt;

&lt;p&gt;EXAMPLE:&lt;br&gt;
✓ NO 8.This number divide by 1,2,4,8 and gets reminder 0.So 8 have four divisors and not a prime number.&lt;/p&gt;

&lt;p&gt;✓ NO 13.This number divide by 1 and 13 and gets reminder 0.so 13 have 2 divisors and prime number.&lt;/p&gt;

&lt;p&gt;PROGRAM:&lt;br&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%2Fm6afjy5tc10hq6bap2lt.jpg" 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%2Fm6afjy5tc10hq6bap2lt.jpg" alt=" " width="712" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EXPLANATION:&lt;/p&gt;

&lt;p&gt;1.First take count=0.&lt;/p&gt;

&lt;p&gt;2.Then take number = 10.&lt;/p&gt;

&lt;p&gt;3.Next take initial value i=1.&lt;/p&gt;

&lt;p&gt;4.Then check the condition , number is 10, so take the value (i&amp;lt;=number).&lt;/p&gt;

&lt;p&gt;5.Next check the if condition (number % i == 0).&lt;/p&gt;

&lt;p&gt;◾ i is 1.(1&amp;lt;=number true).Then go next step.&lt;br&gt;
(number(10) % 1== 0 true).because the 10 is divided by 1 and the remaider is 0.Condition is true.Then,&lt;/p&gt;

&lt;p&gt;6.Increment the value of count++.&lt;/p&gt;

&lt;p&gt;7.Then increment the value of i++.&lt;/p&gt;

&lt;p&gt;◾ i is 2.(2&amp;lt;=number true).(number(10) % 2== 0 true).go to next step .count is 2.&lt;/p&gt;

&lt;p&gt;◾ i is 3.(3&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 4.(4&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 5.(5&amp;lt;=number true).(number(10) % 1== 0 true).&lt;br&gt;
count is 3.&lt;/p&gt;

&lt;p&gt;◾ i is 6.(6&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 7.(7&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 8.(8&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 9.(9&amp;lt;=number true).(number(10) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 10.(10&amp;lt;=number true).(number(10) % 1== 0 true).&lt;br&gt;
count is 4.&lt;/p&gt;

&lt;p&gt;◾ i is 11.(11&amp;lt;=number false).then while loop breaks.&lt;/p&gt;

&lt;p&gt;8.Then give if(count==2)&lt;br&gt;
   Print(prime number).&lt;/p&gt;

&lt;p&gt;9.Else&lt;br&gt;
    Print(not a prime number).&lt;/p&gt;

&lt;p&gt;◾ Count is now 4.&lt;br&gt;
  ◾ if(4==2).false.Not a prime number.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2F3a905ywtnz9q35ouq3n8.jpg" 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%2F3a905ywtnz9q35ouq3n8.jpg" alt=" " width="720" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PROGRAM:&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%2Fllddpr5vs1942c8bmjo0.jpg" 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%2Fllddpr5vs1942c8bmjo0.jpg" alt=" " width="720" height="735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EXPLANATION:&lt;/p&gt;

&lt;p&gt;1.First take count=0.&lt;/p&gt;

&lt;p&gt;2.Then take number = 13.&lt;/p&gt;

&lt;p&gt;3.Next take initial value i=1.&lt;/p&gt;

&lt;p&gt;4.Then check the condition , number is 10, so take the value (i&amp;lt;=number).&lt;/p&gt;

&lt;p&gt;5.Next check the if condition (number % i == 0).&lt;/p&gt;

&lt;p&gt;◾ i is 1.(1&amp;lt;=number true).Then go next step.&lt;br&gt;
(number(13) % 1== 0 true).because the 13 is divided by 1 and the remaider is 0.Condition is true.So count is 1.Then,&lt;/p&gt;

&lt;p&gt;6.Increment the value of count++.&lt;/p&gt;

&lt;p&gt;7.Then increment the value of i++.&lt;/p&gt;

&lt;p&gt;◾ i is 2.(2&amp;lt;=number true).(number(13) % 2== 0 false).go to next step.&lt;/p&gt;

&lt;p&gt;◾ i is 3.(3&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 4.(4&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 5.(5&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 6.(6&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 7.(7&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 8.(8&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 9.(9&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 10.(10&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 11.(11&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 12.(12&amp;lt;=number true).(number(13) % 1== 0 false).&lt;/p&gt;

&lt;p&gt;◾ i is 13.(13&amp;lt;=number true).(number(13) % 1== 0 true).&lt;br&gt;
count is 2.&lt;/p&gt;

&lt;p&gt;◾ i is 14.(14&amp;lt;=number false).then while loop breaks.&lt;/p&gt;

&lt;p&gt;8.Then give if(count==2)&lt;br&gt;
   Print(prime number).&lt;/p&gt;

&lt;p&gt;9.Else&lt;br&gt;
    Print(not a prime number).&lt;/p&gt;

&lt;p&gt;◾ Count is now 2.&lt;br&gt;
  ◾ if(2==2).true.prime number.&lt;/p&gt;

&lt;p&gt;OUTPUT:&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%2Fu7jv4yd0h8rlopgtqq4f.jpg" 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%2Fu7jv4yd0h8rlopgtqq4f.jpg" alt=" " width="711" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

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