<?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: Husain Bhagat</title>
    <description>The latest articles on DEV Community by Husain Bhagat (@husain01).</description>
    <link>https://dev.to/husain01</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%2F649083%2F4a54ffdc-afc4-4136-943e-846689b4dddf.jpeg</url>
      <title>DEV Community: Husain Bhagat</title>
      <link>https://dev.to/husain01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/husain01"/>
    <language>en</language>
    <item>
      <title>Securing Next.js Applications with Robust CSP Headers</title>
      <dc:creator>Husain Bhagat</dc:creator>
      <pubDate>Sun, 14 Apr 2024 11:45:24 +0000</pubDate>
      <link>https://dev.to/husain01/securing-nextjs-applications-with-robust-csp-headers-ioc</link>
      <guid>https://dev.to/husain01/securing-nextjs-applications-with-robust-csp-headers-ioc</guid>
      <description>&lt;p&gt;Keeping your web applications safe is crucial, especially when using frameworks like Next.js that build dynamic sites. One important way to boost security is by setting up Content Security Policy (CSP) headers. In this blog post, I’ll walk you through how to add CSP headers in Next.js, focusing on version 14.2, but this guide should be useful for anyone using Next.js 13 or newer.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why CSP is Important&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;CSP headers protect your app from certain types of attacks, like cross-site scripting (XSS) and unwanted data injection. By specifying which sources your app can trust, CSP prevents harmful scripts from running, making your site safer.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Generic Approach and Its Limitations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Typically, you might find online guides suggesting you to simply modify your &lt;strong&gt;&lt;code&gt;next.config.js&lt;/code&gt;&lt;/strong&gt; file to add CSP headers. While this approach can work for adding general headers, it often falls short when dealing with more complex configurations or specific security requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Follow the Official Documentation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It's best to follow the official Next.js documentation for the most reliable instructions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy#why-use-a-nonce"&gt;Next.js CSP Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, even the official guide has some gaps, which you might discover the hard way through trial and error. That's what leads many developers to seek out additional resources like this blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Addressing the Gaps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you've followed the documentation, you might find everything works perfectly in your local development environment. But as soon as you build and run your application, you encounter errors related to script handling, which are often not nonce-compliant.&lt;/p&gt;

&lt;p&gt;This issue arises because, by default, Next.js does server-side rendering (SSR), and during the build and run phase, the nonces for scripts generated by Webpack aren't set correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Solution&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Currently, the best solution is to include the following line in your root layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dynamic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;force-dynamic&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This directive opts the component out of static optimization, which can interfere with nonce propagation and CSP enforcement during the build process.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final Steps&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Make sure that your root layout is configured as a server component, not a client component. This is crucial because server components handle headers and optimizations differently, affecting your security settings directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Implementing robust CSP headers in Next.js requires more than just adding a few lines of code to your configuration. Understanding the nuances of nonce management and how Next.js handles scripts and styles at build time can save you from security headaches. By following the steps outlined above, you can ensure that your application not only runs smoothly but also maintains high security standards.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>As you start the development journey, here are the essential tools you will need.</title>
      <dc:creator>Husain Bhagat</dc:creator>
      <pubDate>Sat, 14 Aug 2021 17:50:30 +0000</pubDate>
      <link>https://dev.to/husain01/as-you-start-the-development-journey-here-are-the-essential-tools-you-will-need-11kc</link>
      <guid>https://dev.to/husain01/as-you-start-the-development-journey-here-are-the-essential-tools-you-will-need-11kc</guid>
      <description>&lt;p&gt;In this blog, I am going to address some of the most important things you need to consider to have with you to make your Web Dev Journey a smooth experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Mindset
&lt;/h2&gt;

&lt;p&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%2Fngr7gx52g6bmv6gtv2pz.jpg" 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%2Fngr7gx52g6bmv6gtv2pz.jpg" alt="Alt Text" width="800" height="641"&gt;&lt;/a&gt;&lt;br&gt;
The No.1 one thing and also a cliche is that you need to have the correct mindset to start this journey. If you are only getting into this journey thinking you can make some good bucks then maybe you won't last. &lt;/p&gt;

&lt;p&gt;Initially, you will need to put in a few months of work to learn the basics of coding. The mindset of showing up every day and creating a habit of coding a minimum of an hour will have compounding results.&lt;br&gt;
Some days you might feel that this isn't worth it. In those days, the right mindset along with your habit will put you right on track.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Basic Peripherals
&lt;/h2&gt;

&lt;p&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%2Fxp6w0sm0mq6yhe7b13r9.jpg" 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%2Fxp6w0sm0mq6yhe7b13r9.jpg" alt="Alt Text" width="800" height="315"&gt;&lt;/a&gt;&lt;br&gt;
This consists of a good laptop or a desktop. One which is smooth to use and doesn't lag or is slow. This is very much important since a slow computer may hinder your whole experience and put you off track.&lt;/p&gt;

&lt;p&gt;Another thing which is even more important is a fast and reliable internet connection. You might be lucky if you are living in India since there is a telecom war which is a blessing in disguise for you. Having a fast internet connection has a similar effect where you won't be bugged while the page is buffering.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. A good Environment
&lt;/h2&gt;

&lt;p&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%2Fmb3wm24dqt67u2lf7li9.jpg" 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%2Fmb3wm24dqt67u2lf7li9.jpg" alt="Alt Text" width="800" height="590"&gt;&lt;/a&gt;&lt;br&gt;
Don't use your bed as the place to learn. Having a proper desk for your work or study is crucial. There are many types of research and psychologically your mind differentiates a place of work from a place of rest. Having a good desk at optimum height and enough space along with an ergonomic chair is so very important. &lt;br&gt;
Also having a proper corner for it helps your brain to map out that it is your working area, so whenever you go and sit there and start your work, now your brain knows it's time to tighten the shoes,&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Cut off Distractions
&lt;/h2&gt;

&lt;p&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%2Fxsmw6jussfv7940eea59.jpg" 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%2Fxsmw6jussfv7940eea59.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
Highly inspired by the book "Deep Work", whenever you start to code, put your phone in another room. Firstly, you'll save loads of time, since we are habituated to check our phones on a timely basis. Secondly, any notifications that pop off won't bother you or urge you to check it out. OUT OF SIGHT OUT OF MIND.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Right Resources
&lt;/h2&gt;

&lt;p&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%2F839drf8a3b3vvle7jp3i.jpg" 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%2F839drf8a3b3vvle7jp3i.jpg" alt="Alt Text" width="800" height="599"&gt;&lt;/a&gt;&lt;br&gt;
I know you are amazed as to why I reached this part so late in my blog. Well, all the things mentioned above are very crucial mentally and physically to put you in your seat for long hours. Now it's also important to find the right resources to learn. Before that, learn to google search things the right way i.e., learn how to put in the right keywords in google to fetch you the most accurate results.&lt;br&gt;
You can learn coding either via books or via videos. I would recommend you to go with the video tutorials. Just go to Youtube and search for whatever you want to learn and you will be provided with a playlist from various creators and developers. Pick any one and checkout a few videos and see whether the teaching style matches with your learning style. &lt;/p&gt;

&lt;p&gt;One such resource to learn web development would be Tanay Pratap's LevelZero. Also if you know hindi then you can checkout CodeWithHarry's channel too.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Don't forget the Roadmap
&lt;/h2&gt;

&lt;p&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%2Fbn3sjbo81thgii2lewwa.jpg" 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%2Fbn3sjbo81thgii2lewwa.jpg" alt="Alt Text" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
Roadmaps are important. It helps you get an overview of what lies ahead and also what all levels do you have to pass through. Treat roadmap as a game where each language or thing is a level. This will gamify the whole process and make it enjoyable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. A community or accountability partner
&lt;/h2&gt;

&lt;p&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%2Fhipfo06b9rqd0j7tmyka.jpg" 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%2Fhipfo06b9rqd0j7tmyka.jpg" alt="Alt Text" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
Join in a community or find an accountability partner. I'd recommend joining a community where you can easily find an accountability partner there. This helps you whenever you are feeling down or have a doubt which after googling and trying out cannot be solved. Turn to the community or to your partner and speak up. This also helps a little bit with your soft skills in general.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Showcase your work
&lt;/h2&gt;

&lt;p&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%2Fypjcij2uu8l43n23b5yq.jpg" 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%2Fypjcij2uu8l43n23b5yq.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
It's really important to showcase your work, however horrible or novice it may feel. That's how you'll improve and it will create a feedback loop for you. Not necessary to share it with those who are into development but in general. This will help you in your user experience and design too. &lt;/p&gt;

&lt;h2&gt;
  
  
  9. Write
&lt;/h2&gt;

&lt;p&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%2F3ah2csu963r2lm6ojp07.jpg" 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%2F3ah2csu963r2lm6ojp07.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
This may sound odd, it did for me too, but writing helps you accumulate your knowledge on that subject into easy and understandable bite-sized content. This will also help you to find what you actually didn't understand since before writing you do a ton of research and viola you learn there too. This also helps with your communication skills in general where you will become a good communicator which is very much vital for your future endeavours.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Just Start
&lt;/h2&gt;

&lt;p&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%2Fdcusvswz40pbtazc13qe.jpg" 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%2Fdcusvswz40pbtazc13qe.jpg" alt="Alt Text" width="800" height="534"&gt;&lt;/a&gt;&lt;br&gt;
Even if you don't have a fancy desk or an awesome mechanical keyboard it doesn't matter. All you need is the internet and the grit to learn. Beg, borrow, steal but put in the work. You may not see the effects right away but it will, definitely will compound one day. Show up daily, take it up into your stride and make it a habit to code at least an hour minimum. Even if you read about some concepts on your low days it's enough, but keep the bandwagon moving. &lt;/p&gt;

&lt;p&gt;That's all from my side. This whole blog is quite enthusiastically written as it really resonates with me. I hope this helps and inspires you, even a little bit. If there are additional points to add do tell me. Always ready to learn and grow. Adios.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>Converting JavaScript to ES6: A blog explaining the benefits of ES6.</title>
      <dc:creator>Husain Bhagat</dc:creator>
      <pubDate>Mon, 09 Aug 2021 08:35:34 +0000</pubDate>
      <link>https://dev.to/husain01/converting-javascript-to-es6-a-blog-explaining-the-benefits-of-es6-1ibg</link>
      <guid>https://dev.to/husain01/converting-javascript-to-es6-a-blog-explaining-the-benefits-of-es6-1ibg</guid>
      <description>&lt;p&gt;If you're still writing your code in ES5, it's about time you got "ES6". ES6 is a new generation of Javascript that will make writing cleaner and powerful code easier than ever before. This blog post should set you on your path to converting ES5 to ES6.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what is ES6?
&lt;/h2&gt;

&lt;p&gt;ECMAScript 6 (ES6) was the second major revision to Javascript in 2015, which simplifies the code and enables us to write less and do more. It has a lot of new features and new syntaxes to make your code looks more modern, more structured and more readable. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Variable Creation using let and const
&lt;/h2&gt;

&lt;p&gt;let: It is a mutable variable, which means we can reassign its value. let can be declared without being initialized. It is much similar to var but you cannot redeclare the same let variable again in the same scope unlike in var. This is very useful during programming as it avoids mistakes.&lt;/p&gt;

&lt;p&gt;const: It is an immutable variable except when it is used in objects, which means we cannot reassign its value to const variables. const must be initialized during declaration.&lt;/p&gt;

&lt;p&gt;let is the same as const in that both are blocked-scope. It means that the variable is only available within its scope.&lt;/p&gt;

&lt;p&gt;Traditional var variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9oe9e3s1htpx01931rz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9oe9e3s1htpx01931rz.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ES6 let variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksdsj8wn92eifznw9x0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksdsj8wn92eifznw9x0w.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ES6 const variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4n6lsfrkt2f6vb2q5kr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4n6lsfrkt2f6vb2q5kr.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Arrow Functions
&lt;/h2&gt;

&lt;p&gt;Let's start by showing you how we write the function in traditional syntax:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft94fkzzlw3ef5cedjmz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft94fkzzlw3ef5cedjmz5.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how we rewrite it in ES6 syntax:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76epw97ebmolspimvol3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76epw97ebmolspimvol3.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's awesome since the arrow function makes your code looks clean, more structured and more readable.&lt;/p&gt;

&lt;p&gt;When the body inside arrow function has more than one line, we need to wrap it inside {} like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjzyzzz4v39hr2jv71mj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjzyzzz4v39hr2jv71mj.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Arrow functions are frequently used as callbacks. You will find them a lot when you're working with map(), filter() and reduce().&lt;/p&gt;

&lt;p&gt;This is how we traditionally write a map function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyncakvx2na8d5l1bi5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyncakvx2na8d5l1bi5i.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how ES6 simplifies it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg328u7fxyo1yel6j3v9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg328u7fxyo1yel6j3v9t.png" alt="Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although the addition of Arrow Functions is powerful, there are limitations that we need to understand in order to avoid errors that will be difficult to track down, such as when using the this keyword inside an arrow function.&lt;/p&gt;

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

&lt;p&gt;Template literals are a new addition in ES6 just like string interpolation, but more powerful because you can use expressions inside them.&lt;/p&gt;

&lt;p&gt;Let's take a look at code example below.&lt;/p&gt;

&lt;p&gt;This is how we create greetings function that will greet the given name in traditional syntax.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F945vmq7k10mdf8r3d1iu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F945vmq7k10mdf8r3d1iu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's refactor to template literals!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gdrauvx8scn882kmjbe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gdrauvx8scn882kmjbe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we can more easily see the structure of the data in our code. We don't need the + sign anymore and we can use ${} to call variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Rest Parameters and Spread Syntax
&lt;/h2&gt;

&lt;p&gt;Previously, before we had rest parameter, we had to code like this to convert arguments to array. However, it only supports limited number of arguments and you need to be sure how many items are there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpalidfinz4glk485da60.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpalidfinz4glk485da60.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But with ES6, it introduced the REST Parameter. It accepts unlimited arguments and returns it as array. You can use rest parameter by adding three dots .... . When you use rest paramater as argument inside a function, it must be at the end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw3s53avk1sijs6596zi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw3s53avk1sijs6596zi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because it turns our parameters into an array, we can combine it with map() just like the example below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw3s53avk1sijs6596zi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw3s53avk1sijs6596zi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we have spread syntax &lt;code&gt;...&lt;/code&gt;, which looks exactly the same as rest parameter. However, spread syntax does quite the opposite of rest parameter. With spread syntax we can get list of arguments from array or Key-Value pairs in the case of Objects.&lt;/p&gt;

&lt;p&gt;It can be used for creating the reference elements. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjry7pwej5711bk1ifrpk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjry7pwej5711bk1ifrpk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case of Objects -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyc0gmgtd6cg3ahgj7xl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyc0gmgtd6cg3ahgj7xl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Default Parameters
&lt;/h2&gt;

&lt;p&gt;In ES6, we can give default value to function's parameters.&lt;/p&gt;

&lt;p&gt;With the old syntax, this is how we create default value to a parameter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvcjxvbsl1iwkmz4ytue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvcjxvbsl1iwkmz4ytue.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's refactor using ES6 default parameter!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jp7i6gqds6hgc3y2z3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jp7i6gqds6hgc3y2z3q.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's so simple and easy to understand. This also helps you to handle error in advance when you forget to assign the parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Destructuring Assignment
&lt;/h2&gt;

&lt;p&gt;Destructuring allows us to Unpack arrays or Objects into a bunch of variables which makes working with arrays and objects more convenient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Array
&lt;/h3&gt;

&lt;p&gt;The traditional way:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfaqgex70uafjhtcnjm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfaqgex70uafjhtcnjm0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using Destructuring:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0c49v4uq6sowbngfxfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0c49v4uq6sowbngfxfy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also use destructuring assignment to swap between two values in array.&lt;/p&gt;

&lt;p&gt;Here's how we swap array using traditional syntax.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65lmhn1xvvu88k7ounuw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65lmhn1xvvu88k7ounuw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now, let's refactor the code using destructuring assignment!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F90sx00apypotm2yueuh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F90sx00apypotm2yueuh6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have less code and it's easier to understand, isn't it awesome?&lt;/p&gt;

&lt;h3&gt;
  
  
  Object
&lt;/h3&gt;

&lt;p&gt;We can also use destructuring assignment with object. Take a look at the example below.&lt;/p&gt;

&lt;p&gt;Here's how we do it with traditional syntax to get the object's value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodol81qijtb17bsgq0zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodol81qijtb17bsgq0zc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's refactor with destructuring assignment!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6y4ee2cnrtpzi7s4ap4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6y4ee2cnrtpzi7s4ap4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a lot more you can do with destructuring assignment as it is really useful and practical, especially when you are working with modern Javascript.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Array Functions: find() and findIndex()
&lt;/h2&gt;

&lt;p&gt;find() is used to search for element in the array that matches some condition. it returns the first element that matches the condition.&lt;/p&gt;

&lt;p&gt;findIndex() returns the index of the element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6y4ee2cnrtpzi7s4ap4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6y4ee2cnrtpzi7s4ap4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Classes
&lt;/h2&gt;

&lt;p&gt;Classes are a template for creating objects. They encapsulate data with code to work on that data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnan7ni1zud2kgfnfhtt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnan7ni1zud2kgfnfhtt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance.&lt;/p&gt;

&lt;p&gt;Strict mode makes several changes to normal JavaScript semantics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Eliminates some JavaScript silent errors by changing them to throw errors.&lt;/li&gt;
&lt;li&gt;Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode.&lt;/li&gt;
&lt;li&gt;Prohibits some syntax likely to be defined in future versions of ECMAScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fski7an6zbptl0min18bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fski7an6zbptl0min18bv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdl61fczb88ohs3qdbhnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdl61fczb88ohs3qdbhnf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Import and Export
&lt;/h2&gt;

&lt;p&gt;Using import and export in your JavaScript application makes it more powerful. They allow you to create separate and reusable components.&lt;/p&gt;

&lt;p&gt;It is simple! export allows you to export a module to be used in another JavaScript component. We use import to import that module to use it in our component.&lt;/p&gt;

&lt;p&gt;Export: You can export a variable using the export keyword in front of that variable declaration. You can also export a function and a class by doing the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9nf190gj37doww5btur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9nf190gj37doww5btur.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Import: You can import a variable using import keyword. You can specify one of all the members that you want to import from a JavaScript file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqsh2m0g7xudnvs5s4s4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqsh2m0g7xudnvs5s4s4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Promises
&lt;/h2&gt;

&lt;p&gt;A promise is used to handle the asynchronous result of an operation. JavaScript is designed to not wait for an asynchronous block of code to completely execute before other synchronous parts of the code can run. For instance, when making API requests to servers, we have no idea if these servers are offline or online, or how long it takes to process the server request.&lt;/p&gt;

&lt;p&gt;With Promises, we can defer execution of a code block until an &lt;strong&gt;&lt;code&gt;async&lt;/code&gt;&lt;/strong&gt; request is completed. This way, other operations can keep running without interruption.&lt;/p&gt;

&lt;p&gt;Promises have Three States:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pending: This is the initial state of the Promise before an operation begins&lt;/li&gt;
&lt;li&gt;Fulfilled: This means the specified operation was completed&lt;/li&gt;
&lt;li&gt;Rejected: The operation did not complete; an error value is usually thrown&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating a Promise&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Promise object is created using the new keyword and contains the &lt;strong&gt;&lt;code&gt;promise&lt;/code&gt;&lt;/strong&gt;; this is an executor function which has a resolve and a reject callback. As the names imply, each of these callbacks returns a value with the reject callback returning an error object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxn0bqwrxwjt92mgm84m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxn0bqwrxwjt92mgm84m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using a Promise&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Using a promise that has been created is straightforward; we use &lt;strong&gt;&lt;code&gt;.then()&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;.catch()&lt;/code&gt;&lt;/strong&gt; to our Promise like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx1de3gtbsljxoexe3z6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx1de3gtbsljxoexe3z6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8khmbri6rsqfav5t2zu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8khmbri6rsqfav5t2zu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Async and Await
&lt;/h2&gt;

&lt;p&gt;An async function is a modification to the syntax used in writing promises. An async function returns a promise -- if the function returns a value, the promise will be resolved with the value, but if the async function throws an error, the promise is rejected with that value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw3x5mfmktan6gtn97j6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftw3x5mfmktan6gtn97j6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Await is only used with an async function. The await keyword is used in anasync function to ensure that all promises returned in the async function are synchronized, ie. they wait for each other. Await eliminates the use of callbacks in .then() and .catch(). In using async and await, async is prepended when returning a promise, await is prepended when calling a promise. try and catch are also used to get the rejection value of an async function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53n1i95cylvsqezn9pd3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53n1i95cylvsqezn9pd3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Understanding the concepts of Callbacks, Promises, and async/await can be tricky sometimes, it was for me, but till now we have seen how they will work when carrying out asynchronous operations and other ES6 features in JavaScript.&lt;/p&gt;

&lt;p&gt;These techniques will come in handy a lot when making API requests and event handling. &lt;/p&gt;

&lt;p&gt;I hope you guys found this article useful, and I hope I was able to introduce you to some of the ES6 features.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>es6</category>
    </item>
    <item>
      <title>Want to learn JavaScript ? Here's a Detailed Roadmap for you</title>
      <dc:creator>Husain Bhagat</dc:creator>
      <pubDate>Mon, 14 Jun 2021 03:49:02 +0000</pubDate>
      <link>https://dev.to/husain01/want-to-learn-javascript-here-s-a-detailed-roadmap-for-you-586b</link>
      <guid>https://dev.to/husain01/want-to-learn-javascript-here-s-a-detailed-roadmap-for-you-586b</guid>
      <description>&lt;p&gt;A Detailed Roadmap for you👇&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with &lt;a href="https://freecodecamp.org's"&gt;https://freecodecamp.org's&lt;/a&gt; - JavaScript Algorithms and Data Structures Certification and finish the "Basic JavaScript" module.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You'll get a basic understanding of JavaScript and Programming in &lt;br&gt;
 general.&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%2Frtitqksn0i3ugh5i74uk.jpg" 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%2Frtitqksn0i3ugh5i74uk.jpg" alt="Alt Text" width="623" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Move to &lt;a href="http://JavaScript.info"&gt;http://JavaScript.info&lt;/a&gt; and complete the following parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Introduction&lt;/li&gt;
&lt;li&gt;JavaScript Fundamentals
You'll start to understand Basic JavaScript concepts and their details.
&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%2Fmx7a23pxfqyhma3p3otp.jpg" alt="Alt Text" width="800" height="311"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complete "Objects: the basics" section in &lt;a href="http://JavaScript.info"&gt;&lt;/a&gt;&lt;a href="http://JavaScript.info"&gt;http://JavaScript.info&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By this point you'll have a decent understanding of JavaScript Objects&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Time to return to freeCodeCamp. Finish the following sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;li&gt;Basic Data Structure
&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%2Fbumbczo7yq1241bpkuqn.jpg" alt="Alt Text" width="636" height="358"&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%2Fbumbczo7yq1241bpkuqn.jpg" alt="Alt Text" width="636" height="358"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complete "Data types" Section in &lt;a href="http://JavaScript.info"&gt;&lt;/a&gt;&lt;a href="http://JavaScript.info"&gt;http://JavaScript.info&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations!🎉🎉🎉&lt;br&gt;
Now you have a great understanding of JS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Time to move back to freeCodeCamp. Complete the following sections in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ES6&lt;/li&gt;
&lt;li&gt;Object Oriented Programming&lt;/li&gt;
&lt;li&gt;Functional Programming&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finish Part 1 of &lt;a href="http://JavaScript.info"&gt;&lt;/a&gt;&lt;a href="http://JavaScript.info"&gt;http://JavaScript.info&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finish freeCodeCamp's JavaScript Algorithms and Data Structures Certification&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now you'll have to learn something called DOM. For that you'll need a basic understanding of HTML and CSS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For learning DOM, I would recommend the following two resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Part 2 of &lt;a href="http://JavaScript.info"&gt;http://JavaScript.info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MDN &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Practice by making small projects from &lt;a href="http://JavaScript30.com"&gt;http://JavaScript30.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations! You know JS🔥💯&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My Learning Methods (applicable on mostly every technical skill)</title>
      <dc:creator>Husain Bhagat</dc:creator>
      <pubDate>Mon, 14 Jun 2021 03:21:46 +0000</pubDate>
      <link>https://dev.to/husain01/my-learning-methods-applicable-on-mostly-every-technical-skill-45oj</link>
      <guid>https://dev.to/husain01/my-learning-methods-applicable-on-mostly-every-technical-skill-45oj</guid>
      <description>&lt;p&gt;I had started a #21DaysOfJavaScript challenge where I learnt JavaScript for 21 days. This was to build the habit of coding for a lifetime and have a fixed routine where I have time-blocked a few hours for my learning. Here is a list of the five most useful things which helped in my journey:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Accountability
&lt;/h3&gt;

&lt;p&gt;The first reason and the most important one is accountability. I informed publicly through the social media platforms and so by committing myself out in public I'm making sure I stick to my goals. Also psychologically we are prone to achieve something if it's announced and seen by people. I might not procrastinate much as I used to and start getting things done.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Pseudo Teaching
&lt;/h3&gt;

&lt;p&gt;The other reason I did this is was because I would have been learning the fundamentals of JavaScript but also I would also be teaching my own self. I had gone through a ton of resources and curated (much of it is curated online I'm just choosing) many lessons and topics that I'll be learning.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Time Management
&lt;/h3&gt;

&lt;p&gt;I had alloted my whole morning to this challenge where I revised, learnt new concepts, and hard-coded them into projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Note-Taking
&lt;/h3&gt;

&lt;p&gt;I usually do not like to take notes, thinking that I might remember it in the long term. I don't. Hence I also created a summary of all the concepts I've learned for that day.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Documentation
&lt;/h3&gt;

&lt;p&gt;This is new and quite effective to me. I document my process of learning and iterated and always tried to make it better. Documenting will also help me later on with different opportunities and grow my social profile. Highly recommended.&lt;/p&gt;

&lt;p&gt;These are some of the reasons I had  come up with to take this step. It was quite new and exciting for me since I was experimenting but it turned out really good.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
