<?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: Syed Hasnat Haider Shah</title>
    <description>The latest articles on DEV Community by Syed Hasnat Haider Shah (@hasnat12).</description>
    <link>https://dev.to/hasnat12</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%2F1116355%2Fcafb1229-f6d6-4b8b-be58-c5f5b185d195.png</url>
      <title>DEV Community: Syed Hasnat Haider Shah</title>
      <link>https://dev.to/hasnat12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hasnat12"/>
    <language>en</language>
    <item>
      <title>Mastering Advanced JavaScript Operators: The Ultimate Guide</title>
      <dc:creator>Syed Hasnat Haider Shah</dc:creator>
      <pubDate>Thu, 07 Sep 2023 08:08:01 +0000</pubDate>
      <link>https://dev.to/hasnat12/mastering-advanced-javascript-operators-the-ultimate-guide-aok</link>
      <guid>https://dev.to/hasnat12/mastering-advanced-javascript-operators-the-ultimate-guide-aok</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cpRqvH8V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/io3nkiy6xgcxcgjspgfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cpRqvH8V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/io3nkiy6xgcxcgjspgfs.png" alt="Image description" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is a versatile programming language, known for its powerful operators that allow developers to perform a wide variety of operations on data. While basic operations like addition (+) and subtraction (-) are familiar to most developers, &lt;strong&gt;mastering advanced JavaScript operators&lt;/strong&gt; can take your coding skills to the next level. In this final guide, we explore some powerful and underused JavaScript users with creative examples that you can create and try for yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Ternary Operator (Conditional Operator) ? :
&lt;/h2&gt;

&lt;p&gt;The ternary operator is a concise way to write conditional statements. It's often used for simple decision-making within a single line of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const age = 18;
const canVote = age &amp;gt;= 18 ? 'Yes' : 'No';
console.log(`Can I vote? ${canVote}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This code checks if age is greater than or equal to 18 and assigns either 'Yes' or 'No' to the canVote variable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Nullish Coalescing Operator (??):
&lt;/h2&gt;

&lt;p&gt;The nullish coalescing operator allows you to choose a default value when dealing with null or undefined values.&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: 'John',
    email: null,
};
const userEmail = user.email ?? 'No email available';
console.log(`User Email: ${userEmail}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This code assigns 'No email available' to userEmail since user.email is null.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Optional Chaining Operator (?.):
&lt;/h2&gt;

&lt;p&gt;The optional chaining operator simplifies working with deeply nested objects and prevents errors when properties are undefined.&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: 'Alice',
    address: {
        city: 'New York',
    },
};
const userCity = user.address?.city ?? 'Unknown';
console.log(`User's City: ${userCity}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Even if the address property is undefined, this code won't throw an error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Bitwise Operators (&amp;amp;, |, ^, ~):
&lt;/h2&gt;

&lt;p&gt;Bitwise operators perform operations at the binary level, which can be useful for manipulating individual bits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x = 5; // Binary: 0101
const y = 3; // Binary: 0011

const bitwiseAnd = x &amp;amp; y; // Result: 0001 (Decimal: 1)
const bitwiseOr = x | y;  // Result: 0111 (Decimal: 7)
const bitwiseXor = x ^ y; // Result: 0110 (Decimal: 6)
const bitwiseNot = ~x;    // Result: 11111010 (Decimal: -6)

console.log(`Bitwise AND: ${bitwiseAnd}`);
console.log(`Bitwise OR: ${bitwiseOr}`);
console.log(`Bitwise XOR: ${bitwiseXor}`);
console.log(`Bitwise NOT: ${bitwiseNot}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;These operators are particularly useful in low-level operations and encoding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Logical Nullish Assignment (??=):
&lt;/h2&gt;

&lt;p&gt;This operator assigns a value to a variable only if the variable is null or undefined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let score = null;
score ??= 10;
console.log(`User's Score: ${score}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;In this example, score will be assigned 10 because it was initially null.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Mastering advanced JavaScript functionality can greatly enhance your coding abilities. Although these professionals are underutilized, they provide powerful solutions to common policy challenges. By using these examples and integrating them into your projects, you will become a much more proficient JavaScript developer. So go ahead, unlock the power of these moderators, and upgrade your &lt;strong&gt;JavaScript skills&lt;/strong&gt;!.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>operators</category>
    </item>
    <item>
      <title>Challenge: Dynamic Emoji Page</title>
      <dc:creator>Syed Hasnat Haider Shah</dc:creator>
      <pubDate>Tue, 08 Aug 2023 10:18:28 +0000</pubDate>
      <link>https://dev.to/hasnat12/challenge-dynamic-emoji-page-842</link>
      <guid>https://dev.to/hasnat12/challenge-dynamic-emoji-page-842</guid>
      <description>&lt;h2&gt;
  
  
  Challenge: Dynamic Emoji Page
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MKKTeTv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0h0hsbjqd5uxzvl01hvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MKKTeTv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0h0hsbjqd5uxzvl01hvd.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a Next.js application that generates a dynamic page for each emoji, where the URL structure is based on the emoji's shortcode. For example, the page for the "😄" emoji would be accessible at &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;/emoji/joy.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;ul&gt;
&lt;li&gt;Create a JSON file containing a list of emojis, each with a shortcode and emoji property. (You can find a list of emojis and their shortcodes online.)&lt;/li&gt;
&lt;li&gt;Build a homepage that lists all the available emojis with their shortcodes and displays the emoji itself.&lt;/li&gt;
&lt;li&gt;Clicking on an emoji on the homepage should navigate to its dynamic page.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a dynamic page for each emoji using Next.js routing. The page should display the emoji, its shortcode, and a fun fact about it.&lt;br&gt;
&lt;strong&gt;Bonus Challenges:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement a search functionality on the homepage that allows users to filter emojis by name or shortcode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a random emoji button on the homepage that navigates to a random emoji's dynamic page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use CSS animations or transitions to make the emoji interactions more engaging.&lt;br&gt;
Deploy the application to a hosting platform like Vercel or Netlify.&lt;br&gt;
&lt;strong&gt;Hints:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use Next.js's dynamic routing feature to create dynamic pages based on the emoji shortcode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Utilize query parameters or route parameters to pass data to the dynamic pages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use CSS-in-JS libraries like styled-components or CSS modules to style your components.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This challenge will test the developer's knowledge of dynamic routing, working with JSON data, creating reusable components, and using CSS for styling. It's a creative and engaging way to explore Next.js capabilities while having fun with emojis!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
