<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: yns</title>
    <description>The latest articles on DEV Community by yns (@yns666).</description>
    <link>https://dev.to/yns666</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%2F1076682%2Fb7992aa2-d3d6-4d3b-a29e-2ee948bbe8e7.png</url>
      <title>DEV Community: yns</title>
      <link>https://dev.to/yns666</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yns666"/>
    <language>en</language>
    <item>
      <title>How to check if a value is present in an array.</title>
      <dc:creator>yns</dc:creator>
      <pubDate>Wed, 30 Apr 2025 13:41:19 +0000</pubDate>
      <link>https://dev.to/yns666/how-to-check-if-a-value-is-present-in-an-array-2dp5</link>
      <guid>https://dev.to/yns666/how-to-check-if-a-value-is-present-in-an-array-2dp5</guid>
      <description>&lt;p&gt;When working with arrays in JavaScript, one of the cleanest and most efficient ways to check if a value exists is by using the &lt;code&gt;some()&lt;/code&gt; method.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ What is &lt;code&gt;some()&lt;/code&gt;?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;some()&lt;/code&gt; is an array method that takes a callback function.&lt;/li&gt;
&lt;li&gt;It returns:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;true&lt;/code&gt; if &lt;strong&gt;at least one&lt;/strong&gt; element satisfies the condition.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;false&lt;/code&gt; if &lt;strong&gt;no elements&lt;/strong&gt; match.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It stops iterating as soon as a match is found (great for performance).&lt;/li&gt;

&lt;/ul&gt;




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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arr = ['a', 'b', 'c'];
const check = arr.some(x =&amp;gt; x === 'z');
// Output: false

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>node</category>
      <category>npm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is The Ternary Operator In JavaScript ?</title>
      <dc:creator>yns</dc:creator>
      <pubDate>Wed, 14 Aug 2024 14:51:06 +0000</pubDate>
      <link>https://dev.to/yns666/what-is-the-ternary-operator-in-javascript--392o</link>
      <guid>https://dev.to/yns666/what-is-the-ternary-operator-in-javascript--392o</guid>
      <description>&lt;p&gt;Here is The syntax:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lnk8oeo9hqda0or4ks6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lnk8oeo9hqda0or4ks6.png" alt="Ternary operator syntax" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
So basically , It is another way to write the conditional statements (if / else / else if ) in a much simpler way. It is especially used for the non-complex cases.&lt;br&gt;
for example , instead of this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 4;
if (a &amp;gt; 4)
{
console.log("ok");
}
else
{
console.log("not ok");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can just do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;gt; 4 ? console.log("ok") : console.log("not ok");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Difference Between Number() and parseInt() in Converting Strings?</title>
      <dc:creator>yns</dc:creator>
      <pubDate>Sun, 23 Jun 2024 09:10:17 +0000</pubDate>
      <link>https://dev.to/yns666/difference-between-parseint-and-number-in-converting-strings-1fh5</link>
      <guid>https://dev.to/yns666/difference-between-parseint-and-number-in-converting-strings-1fh5</guid>
      <description>&lt;p&gt;Number(): Searches the entire string for numbers. If it finds anything else, it will return NaN (short for Not a Number).&lt;/p&gt;

&lt;p&gt;parseInt() / parseFloat(): Returns the first number in the string, ignoring the rest. If there are no numbers at the beginning of the string, it will return NaN.&lt;/p&gt;

&lt;p&gt;let's take an example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;let a = "1hola1";&lt;br&gt;
console.log(Number(a));&lt;br&gt;
console.log(parseInt(a));&lt;br&gt;
output-&amp;gt;&lt;br&gt;
NaN&lt;br&gt;
1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;let a = "1";&lt;br&gt;
console.log(Number(a));&lt;br&gt;
console.log(parseInt(a));&lt;br&gt;
output-&amp;gt;&lt;br&gt;
1&lt;br&gt;
1&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In conclusion , We use Number() for the Strings that only contains numbers,the parseInt() does the opposite.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Difference Between ++a And a++ In JavaScript?</title>
      <dc:creator>yns</dc:creator>
      <pubDate>Sat, 22 Jun 2024 14:15:47 +0000</pubDate>
      <link>https://dev.to/yns666/difference-between-a-and-a-in-javascript-21n2</link>
      <guid>https://dev.to/yns666/difference-between-a-and-a-in-javascript-21n2</guid>
      <description>&lt;p&gt;The &lt;strong&gt;++&lt;/strong&gt; is responsible of the increment of the number value by 1 . But have you wondered what is the difference between putting it before or after?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;++a&lt;/strong&gt; : returns the value after the increment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;a++&lt;/strong&gt; : returns the value before the increment.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's take an example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let a=0;&lt;br&gt;
a++;&lt;br&gt;
++a;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
the output will be:&lt;br&gt;
&lt;code&gt;output-&amp;gt;0&lt;br&gt;
1&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>.</title>
      <dc:creator>yns</dc:creator>
      <pubDate>Fri, 24 May 2024 10:51:38 +0000</pubDate>
      <link>https://dev.to/yns666/after-learning-html-and-css-should-i-directly-dive-into-a-framework-or-just-master-both-of-them-411a</link>
      <guid>https://dev.to/yns666/after-learning-html-and-css-should-i-directly-dive-into-a-framework-or-just-master-both-of-them-411a</guid>
      <description></description>
    </item>
  </channel>
</rss>
