<?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: Atit Patel</title>
    <description>The latest articles on DEV Community by Atit Patel (@patelatit53).</description>
    <link>https://dev.to/patelatit53</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%2F580562%2F6088d003-7e9b-43c1-8193-1163ce19689e.png</url>
      <title>DEV Community: Atit Patel</title>
      <link>https://dev.to/patelatit53</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/patelatit53"/>
    <language>en</language>
    <item>
      <title>I Earned Over $4000 In 4 Months on Medium</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 03 Mar 2021 16:26:02 +0000</pubDate>
      <link>https://dev.to/patelatit53/i-earned-over-4000-in-4-months-on-medium-5642</link>
      <guid>https://dev.to/patelatit53/i-earned-over-4000-in-4-months-on-medium-5642</guid>
      <description>&lt;h4&gt;
  
  
  My Medium Journey with JavaScript in Plain English, and how I ended up earning over 4000 USD in 4 months
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iBw5pvQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AuHFOHqeZ3c-hYPN3" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iBw5pvQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AuHFOHqeZ3c-hYPN3" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@_javardh_001?utm_source=medium&amp;amp;utm_medium=referral"&gt;Javardh&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Time flies so quickly and One month went so fast. Last month I have wrote an article about how &lt;strong&gt;reached 2200/month after 3 months&lt;/strong&gt; of my medium Journey.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;strong&gt;How I went from earning $0.55 to $2,200+ in 3 Months&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_My Medium Journey with JavaScript In Plain English_javascript.plainenglish.io&lt;/a&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“It is impossible for me to remember how many days or weeks went by in this way. Time is round, and it rolls quickly.” ― &lt;strong&gt;Nikos Kazantzakis,&lt;/strong&gt; &lt;a href="https://www.goodreads.com/work/quotes/921820"&gt;&lt;strong&gt;Saint Francis&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today, I would like to discuss my journey of the fourth month with a lot of ups and downs and what I learned and improved as a writer in the month of February.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;If you missed my previous article let me introduce myself and How I ended up in the medium.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like everyone else, I started my Medium journey by reading different blogs. I bought a Medium subscription in July as I was restricted to read more stories.&lt;/p&gt;

&lt;p&gt;When I joined Medium I had &lt;strong&gt;no intentions&lt;/strong&gt; of trying to earn money from Medium and honestly speaking I had no clue about the Medium writing program. Crazy right?&lt;/p&gt;

&lt;p&gt;I was an Angular Developer for X years and wanted to change my career so I started exploring the latest trends in Frontend Technologies. I started preparing for different questions and Medium was helping me to go through different topics in depth. After 35 days of preparations, I was able to get my dream job as a Senior Consultant in One Company.&lt;/p&gt;

&lt;p&gt;One day suddenly I came across one topic about someone’s journey of earning some amount from the Medium and it motivated me to write and share my research and experiences about topics that most interviewers ask in Angular Interviews.&lt;/p&gt;

&lt;p&gt;This was the first article I wrote in Medium. &lt;em&gt;(Note: I have recently changed title)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/basic-to-tricky-interview-questions-in-angular-2020-part-1-c55a6b2b8d05"&gt;&lt;strong&gt;Advanced Angular interview questions you must prepare in 2021&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_Part 1_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/basic-to-tricky-interview-questions-in-angular-2020-part-1-c55a6b2b8d05"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have received &lt;strong&gt;1 view/day&lt;/strong&gt; after posting this article. I was so happy after seeing that someone is reading my article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FvtCzkJE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AXcGX8eQwOwNLKFjCGmKvYg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FvtCzkJE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AXcGX8eQwOwNLKFjCGmKvYg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After writing one article, I started researching how I can share this article with others and how I can enhance my views and basically make more money.&lt;/p&gt;

&lt;p&gt;I have read a lot of articles so I got the idea of which kind of the content reader wants to read and which motivates them to read my articles. I started with my Interview Questions and I started writing about different topics such as the basics of Angular, Optimization, and Performance Techniques.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--71wmYPbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AK9He9bHFs7BE0pjRpYIFCg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--71wmYPbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AK9He9bHFs7BE0pjRpYIFCg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9942 views/day on January 15&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I got $0.55 USD in my bank I have decided next time I will make more for sure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My first-month earnings:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--orr7xAqq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AQ-LGpUc9j-77iZga5qNGuA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--orr7xAqq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2AQ-LGpUc9j-77iZga5qNGuA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One day I got contacted by one publication to publish my story to their publication. After publishing the story my views got increased and I found a new way to improve the views by publishing stories to publications.&lt;/p&gt;

&lt;p&gt;I started writing more and more which helped me to learn and adapt to different styles. Next month I earned $120.98 and then went to $670.71.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Below are different month’s earning details:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TGEeuWkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2ACqELbFXn7PYNSjBII1M_1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TGEeuWkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2ACqELbFXn7PYNSjBII1M_1w.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To know the tips and How I started writing, you can check my previous article.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;strong&gt;How I went from earning $0.55 to $2,200+ in 3 Months&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_My Medium Journey with JavaScript In Plain English_javascript.plainenglish.io&lt;/a&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, I would like to focus on what I did differently to get 1500 earning in Feburay month. There was a lot of up and downs but I keep myself motivated and reached my goal.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Cross-posting
&lt;/h3&gt;

&lt;p&gt;I recently heard about this term and it is basically publishing your article to the other websites.&lt;/p&gt;

&lt;p&gt;You might ask, Why do we need to do that? From what I understood so far is different people follow different blogging websites in order for them to read your content or expose your material it is better to publish to 2–3 famous blogging websites according to the subject.&lt;/p&gt;

&lt;p&gt;First, consider cross-posting unique content by making slight adjustments to your existing post. This way you will have &lt;strong&gt;two versions of articles&lt;/strong&gt;. You can mention canonical link or where the article originally published in their post settings.&lt;/p&gt;

&lt;p&gt;I found it helpful to post my content to  &lt;a href="https://dev.to/"&gt;&lt;strong&gt;dev.to&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;and&lt;/strong&gt; &lt;a href="https://hashnode.com/"&gt;&lt;strong&gt;hashnode&lt;/strong&gt;&lt;/a&gt;  and I got a decent amount of views in a month there too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h9teWo8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2A1IpgoVYHOqWFocXHWtgubQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h9teWo8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/1%2A1IpgoVYHOqWFocXHWtgubQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Twitter
&lt;/h3&gt;

&lt;p&gt;Yes, Twitter is one more platform where I took lightly. I was using Twitter to share my blog's link but was not focused on interactions and reaching out to more people. This month I did the following things.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. Engaging with more people.&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;You can check out my Twitter. &lt;a href="https://twitter.com/patelatit53"&gt;https://twitter.com/patelatit53&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Exposing a small amount of content to my tweets&lt;/strong&gt;
&lt;/h4&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Using proper tags while tweeting&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;I found the &lt;a href="https://hashtagify.me/"&gt;&lt;strong&gt;https://hashtagify.me/&lt;/strong&gt;&lt;/a&gt;  website very helpful while selecting tags.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. LinkedIn and Facebook groups
&lt;/h4&gt;

&lt;p&gt;I have continued to post my articles to Facebook and Linkedin groups and it helps me to expose my articles to more audiences.&lt;/p&gt;

&lt;p&gt;For Example, I was writing about JavaScript and Angular so I was posting in the below groups and pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://www.linkedin.com/groups/3321309/"&gt;JavaScript Professional Group&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.linkedin.com/groups/8434339/"&gt;Angular 2+&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.linkedin.com/groups/12135868/"&gt;Angular Club — Developers, Professionals &amp;amp; Enthusiasts&lt;/a&gt; ( AngularJS 1.x to Angular8 )&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.facebook.com/groups/JavaScript.Programming"&gt;https://www.facebook.com/groups/JavaScript.Programming&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;To know the tips and How I started writing, you can check my previous article.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;strong&gt;How I went from earning $0.55 to $2,200+ in 3 Months&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_My Medium Journey with JavaScript In Plain English_javascript.plainenglish.io&lt;/a&gt;&lt;a href="https://javascript.plainenglish.io/how-i-went-from-earning-0-55-to-2-200-in-3-months-39cee0507745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Writing more and more.
&lt;/h4&gt;

&lt;p&gt;We cannot define success by just writing some stories and waiting for them to be successful. I believe writing more and more not only helps me to improve my writing but also helping me out to reach more audiences.&lt;/p&gt;

&lt;p&gt;In the month of Feb, I have written 25+ stories on medium and cross-posted 15+ stories on other blogging websites.&lt;/p&gt;

&lt;h4&gt;
  
  
  So what you are waiting for?
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;“Success will never be a big step in the future, success is a small step taken just now.”&lt;/em&gt; ― &lt;strong&gt;Jonatan Mårtensson&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I would like to thank &lt;a href="http://medium.com/javascript-in-plain-english"&gt;JavaScript In Plain English&lt;/a&gt;, and &lt;a href="https://medium.com/u/a7b125868703"&gt;Sunil Sandhu&lt;/a&gt; for guiding me and supporting me in this journey.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;You can check out some of my popular stories in the month of February.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/25-more-stackoverflow-jokes-that-all-devs-can-relate-to-e84f7370a99c"&gt;&lt;strong&gt;25 More StackOverflow Jokes That All Devs Can Relate To&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/30-more-funny-code-comments-d008eb9d085b"&gt;&lt;strong&gt;30 More Funny Code Comments&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;strong&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20 Useful VS Code Extensions for Frontend Developers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/100-coding-terms-and-definitions-every-developer-should-know-be22447b7579"&gt;&lt;strong&gt;100 Coding Terms and Definitions Every Developer Should Know&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/30-friday-stress-relievers-for-programmers-fbcfede676f7"&gt;&lt;strong&gt;30 Stress Relievers For Programmers&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/corporate-jargon-hilarious-phrases-we-use-daily-e854a9efb51f"&gt;&lt;strong&gt;Corporate Jargon: Hilarious Phrases We Use Daily&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/top-programming-blogs-in-2021-723dd49d707e"&gt;&lt;strong&gt;Best Programming Blogs to Learn &amp;amp; Master Your Coding Skills in 2021&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/i-earned-over-4000-in-4-months-on-medium-6a63c7da60e?source=rss-795bd33d705------2"&gt;Continue reading on JavaScript in Plain English »&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>writing</category>
      <category>codenewbie</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>12 Tips To Help You Stay Motivated While Learning To Code</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 03 Mar 2021 16:22:38 +0000</pubDate>
      <link>https://dev.to/patelatit53/12-tips-to-help-you-stay-motivated-while-learning-to-code-4bd</link>
      <guid>https://dev.to/patelatit53/12-tips-to-help-you-stay-motivated-while-learning-to-code-4bd</guid>
      <description>&lt;h4&gt;
  
  
  How To Keep Motivating Yourself While Learning To Code
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--017W_oTe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AbqGCnAocaaDimChB" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--017W_oTe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AbqGCnAocaaDimChB" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@cristofer?utm_source=medium&amp;amp;utm_medium=referral"&gt;Cristofer Jeschke&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the new year starts we take some resolutions and think we will fulfill this resolution no matter how many hurdles I need to face or no matter how much I need to give my favorite things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example,&lt;/strong&gt; there are more than 13% of people who make resolutions to do exercise. but do you think how many of them might fulfill that?&lt;/p&gt;

&lt;p&gt;The exact same thing happens when we decide to learn to code. We quickly take some courses available in Udemy or freeCodeCamp and start practicing them.&lt;/p&gt;

&lt;p&gt;After some weeks, sometimes you feel that the course you took might not have all content you were looking for and you buy some other courses and as all courses have different content, we might lose in the courses itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CRUhVn44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2Aj8etBT6k5YSiGq6K.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CRUhVn44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2Aj8etBT6k5YSiGq6K.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After several months, we might feel that you are nowhere as you have lack knowledge in all the topics and this can lead to disappointment and basically giving up on learning new stuff.&lt;/p&gt;

&lt;p&gt;But do you think what you missed when you start coding? What if someone guided you in the right direction? or someone motivated you throughout this journey?&lt;/p&gt;

&lt;p&gt;If you’re trying to teach yourself how to code, you are probably pretty familiar with the struggles in the story.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A451fXJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AIEYrkQJrh4rxKt5Z" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A451fXJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AIEYrkQJrh4rxKt5Z" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@sevhoein?utm_source=medium&amp;amp;utm_medium=referral"&gt;Severin Höin&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In this article, I would like to discuss some of the actionable tips to keep you motivated in your learning journey.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.plainenglish.io/12-tips-to-help-you-stay-motivated-while-learning-to-code-ee450f9ab951?source=rss-795bd33d705------2"&gt;Continue reading »&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Top Programming Blogs in 2021</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Fri, 26 Feb 2021 15:45:13 +0000</pubDate>
      <link>https://dev.to/patelatit53/top-programming-blogs-in-2021-5fk4</link>
      <guid>https://dev.to/patelatit53/top-programming-blogs-in-2021-5fk4</guid>
      <description>&lt;p&gt;&lt;a href="https://js.plainenglish.io/top-programming-blogs-in-2021-723dd49d707e?source=rss-795bd33d705------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W7msutMB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2600/0%2AvcaqME_cboMFAD9B" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Best Programming Blogs to Master Your Coding Skills in 2021
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://js.plainenglish.io/top-programming-blogs-in-2021-723dd49d707e?source=rss-795bd33d705------2"&gt;Continue reading»&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>51 JavaScript Features covered from ES12 to ES5 you might not know yet</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 24 Feb 2021 15:37:14 +0000</pubDate>
      <link>https://dev.to/patelatit53/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-3ja0</link>
      <guid>https://dev.to/patelatit53/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-3ja0</guid>
      <description>&lt;h4&gt;
  
  
  51 techniques to optimize and clean your code
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8mrJ02RB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2A3todmTrz_q5I8hQo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8mrJ02RB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2A3todmTrz_q5I8hQo.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The future of JavaScript is going to be brilliant. Keeping up with the changes shouldn’t be harder than it already is, and my motive is to introduce all the JavaScript best practices such as shorthand and features which we must know as a frontend developer to make our life easier in 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8y28OnCE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2A0LWgrK4XT6R5xyNw" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8y28OnCE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2A0LWgrK4XT6R5xyNw" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might be doing JavaScript development for a long time but sometimes you might be not updated with the newest features which can solve your issues without doing or writing some extra codes. These techniques can help you to write clean and optimized JavaScript Code. Moreover, these topics can help you to prepare yourself for JavaScript interviews in 2021.&lt;/p&gt;

&lt;p&gt;Here I am coming with a new series to cover all JavaScript features (with versions) that help you to write more clean and optimized JavaScript Code. This is a &lt;strong&gt;Cheat list for JavaScript&lt;/strong&gt; Coding you must know in 2021.&lt;/p&gt;

&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ES2021/ES12
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;replaceAll():&lt;/strong&gt; &lt;em&gt;returns a new string with all matches of a pattern replaced by the new replacement word.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Promise.any():&lt;/strong&gt; &lt;em&gt;It takes an iterable of Promise objects and as one promise fulfills, return a single promise with the value.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;weakref:&lt;/strong&gt; &lt;em&gt;This object holds a weak reference to another object without preventing that object from getting garbage-collected.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;FinalizationRegistry:&lt;/strong&gt; &lt;em&gt;Lets you request a callback when an object is garbage collected.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Private visibility modifier for methods and accessors:&lt;/strong&gt; &lt;em&gt;Private methods can be declared with #.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Logical Operators :&lt;/strong&gt; &lt;em&gt;&amp;amp;&amp;amp; and || operators.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Numeric Separators:&lt;/strong&gt; &lt;em&gt;enables underscore as a separator in numeric literals to improve readability.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Intl.ListFormat :&lt;/strong&gt; &lt;em&gt;This object enables language-sensitive list formatting.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Intl.DateTimeFormat :&lt;/strong&gt; &lt;em&gt;This object enables language-sensitive date and time formatting.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;ES2020/ES11&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;BigInt:&lt;/strong&gt; &lt;em&gt;provides a way to represent numbers(whole) larger than 253–1&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dynamic Import:&lt;/strong&gt; &lt;em&gt;Dynamic imports give the option to import JS files dynamically as modules. It will help you to get modules on demand.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Nullish coalescing Operator:&lt;/strong&gt; &lt;em&gt;returned the right-hand side value if the left-hand side is null or undefined. By default, it will return the left-side value.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;globalThis:&lt;/strong&gt; &lt;em&gt;contains the global&lt;/em&gt; &lt;strong&gt;&lt;em&gt;this&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;value, which basically works as a global object.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Promise.allSettled():&lt;/strong&gt; &lt;em&gt;returns a promise which basically contains the array of objects with the outcome of each promise.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optional Chaining:&lt;/strong&gt; &lt;em&gt;read the value with any connected objects or check methods and check if property existing or not.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;String.prototype.matchAll():&lt;/strong&gt; &lt;em&gt;returns an iterator of all results matching a string against the regex.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Named Export:&lt;/strong&gt; &lt;em&gt;With this feature, we can have multiple named exports per file.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Well defined for-in order:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;import.meta:&lt;/strong&gt; &lt;em&gt;object exposes context-specific metadata to a JS module&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  22 Utility Functions To Ace Your JavaScript Coding Interview
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;strong&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_JavaScript Coding Assessment Cheatsheet 2021_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  ES2019/ES10
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Array.flat():&lt;/strong&gt; &lt;em&gt;creates a new array by&lt;/em&gt; &lt;code&gt;_combining_&lt;/code&gt; &lt;em&gt;the other arrays in the main array. Note: we can set the depth to combine arrays.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Array.flatmap:&lt;/strong&gt; &lt;em&gt;creates a new array by applying&lt;/em&gt; &lt;code&gt;_callback_&lt;/code&gt; &lt;em&gt;function to each element of the array.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object.fromEntries():&lt;/strong&gt; &lt;em&gt;transforms a list of key-value pairs into an&lt;/em&gt; &lt;code&gt;_object._&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;String.trimStart() &amp;amp; String.trimEnd():&lt;/strong&gt; &lt;em&gt;method removes whitespace from the beginning and end of a string.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;try…catch:&lt;/strong&gt; &lt;em&gt;statement marks a block of statements to try and if any error occurs catch will handle it.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Function.toString():&lt;/strong&gt; &lt;em&gt;converts any method/code to&lt;/em&gt; &lt;code&gt;_string_&lt;/code&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Symbol.prototype.description:&lt;/strong&gt; &lt;em&gt;returns optional description of&lt;/em&gt; &lt;code&gt;**_Symbol_**&lt;/code&gt;  &lt;em&gt;objects.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  ES2018/ES9
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Asynchronous Iteration:&lt;/strong&gt; &lt;em&gt;With the help of&lt;/em&gt; &lt;code&gt;**_async_**&lt;/code&gt;  &lt;em&gt;and&lt;/em&gt; &lt;code&gt;**_await_**&lt;/code&gt;  &lt;em&gt;now we can run the series of asynchronous iterations in the for a loop.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Promise.finally():&lt;/strong&gt; &lt;em&gt;returns a promise when it is settled or rejected. It will help to avoid duplicating&lt;/em&gt; &lt;code&gt;**_then_**&lt;/code&gt;  &lt;em&gt;and&lt;/em&gt; &lt;code&gt;**_catch_**&lt;/code&gt;  &lt;em&gt;handlers.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rest/Spread Properties:&lt;/strong&gt; &lt;em&gt;for object&lt;/em&gt; &lt;code&gt;_destructuring_&lt;/code&gt; &lt;em&gt;and arrays.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regular Expression Named Capture Groups:&lt;/strong&gt; &lt;em&gt;can group to be named using the notation&lt;/em&gt; &lt;code&gt;**_?&amp;lt;name&amp;gt;_**&lt;/code&gt;&lt;em&gt;after the opening bracket.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regular Expression s (dotAll) Flag:&lt;/strong&gt; &lt;em&gt;matches any single character except carriage returns. The&lt;/em&gt; &lt;code&gt;_s_&lt;/code&gt; &lt;em&gt;flag changes this behavior so line terminators are permitted&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regular Expression Unicode Property Escapes:&lt;/strong&gt; &lt;em&gt;can set the Unicode property escapes with Unicode&lt;/em&gt; &lt;code&gt;_u_&lt;/code&gt; &lt;em&gt;flag set and&lt;/em&gt; &lt;code&gt;_\p{…}_&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; &lt;code&gt;_\p{…}_&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  ES2017/ES8
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object.entries():&lt;/strong&gt;&lt;em&gt;returns an array of a given objects&lt;/em&gt; &lt;code&gt;_key and value pairs_&lt;/code&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object.values():&lt;/strong&gt; &lt;em&gt;returns an array of given object’s property values.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;padStart():&lt;/strong&gt; &lt;em&gt;pads the current string with another string until the resulting string reaches the length.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;padEnd():&lt;/strong&gt; &lt;em&gt;pads the current string with the given string from the end of the current string.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object.getOwnPropertyDescriptors():&lt;/strong&gt; &lt;em&gt;returns all own property descriptors of a given object.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Async functions:&lt;/strong&gt; &lt;em&gt;expand on Promises to make asynchronous calls.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  ES2016/ES7
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Array.prototype.includes():&lt;/strong&gt; &lt;em&gt;determines whether an array includes a certain value among the given value. It returns true or false.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exponentiation:&lt;/strong&gt; &lt;em&gt;returns a result of raising the first operand to the power of the second operand.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  ES2015/ES6
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Arrow function expressions:&lt;/strong&gt; &lt;em&gt;is alternative to traditional functional expression for some cases&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced Object Literals:&lt;/strong&gt; &lt;em&gt;extended to support setting the object constructions.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Classes:&lt;/strong&gt; &lt;em&gt;create class using&lt;/em&gt; &lt;code&gt;_class_&lt;/code&gt; &lt;em&gt;keyword.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Template Literals:&lt;/strong&gt; &lt;em&gt;can add parameters directly in the string using&lt;/em&gt; &lt;code&gt;_${param}_&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Destructuring Assignment:&lt;/strong&gt; &lt;em&gt;helps to unpack values from arrays or properties from objects.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Default + Rest + Spread:&lt;/strong&gt; &lt;em&gt;supports the default value, spread parameter or array as arguments.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Let + Const:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Promises:&lt;/strong&gt; &lt;em&gt;used for async operations.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modules:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Map + Set + WeakMap + WeakSet:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Math + Number + String + Array + Object APIs:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://js.plainenglish.io/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-47ae27b46133"&gt;let’s checkout detail description with examples.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>42 Tips and Tricks to Write Faster, Better-Optimized JavaScript Code</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 24 Feb 2021 15:34:20 +0000</pubDate>
      <link>https://dev.to/patelatit53/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3onb</link>
      <guid>https://dev.to/patelatit53/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3onb</guid>
      <description>&lt;h4&gt;
  
  
  Optimize your JavaScript code using modern techniques, tips, and tricks
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BzwA8yhj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AxsBpJib2iOy6qSZm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BzwA8yhj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/900/0%2AxsBpJib2iOy6qSZm.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, I create tips for day to day Frontend development.&lt;/p&gt;

&lt;p&gt;You might be doing JavaScript development for a long time but sometimes you might be not updated with the newest features which can solve your issues without doing or writing some extra codes. This article can help you to prepare yourself for JavaScript interviews in 2021.&lt;/p&gt;

&lt;p&gt;Here I am coming with a new series to cover some tips which helped me in my day-to-day coding.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Sort an array of objects by string property value
&lt;/h3&gt;

&lt;p&gt;It can be done in different ways.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Using Underscore
&lt;/h4&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;_.sortBy(collection, [iteratees=[_.identity]])&lt;/code&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: &lt;em&gt;(value)&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var objs = [   { val1: 'abc',val2: 'a' },  { val1: 'cde', val2: 'b'  },  { val1: 'fgh', val2: 'c' }];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var sortedValues = _.sortBy( objs, 'val1' );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Using ES6 sort function
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var data = [  { name: 'abc', value: 21 },  { name: 'cde', value: 37 },  { name: 'ee', value: 45 },  { name: 'ff', value: -12 },  { name: 'ab', value: 13 },  { name: 'cs', value: 37 }];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// sort by valuedata.sort(function (a, b) {  return a.value - b.value;});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Using Lodash
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sortedValues = _.sortBy(data, 'string');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. How to Round to at most 2 decimal places (only if necessary)
&lt;/h3&gt;

&lt;p&gt;There are 3 different ways we can achieve this function.&lt;/p&gt;

&lt;p&gt;Let’s understand some definitions before jumping to the solutions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_parseFloat()_**&lt;/code&gt; function parses an argument (converting it to a string first if needed) and returns a floating point number.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;**_toFixed()_**&lt;/code&gt; method formats a number using fixed-point notation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Using ParseFloat&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parseFloat("183.456").toFixed(2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_Math.round()_**&lt;/code&gt; function returns the value of a number rounded to the nearest integer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2. Using MathRound&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.round( num * 100 + Number.EPSILON ) / 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;[_Number()_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/Number)&lt;/code&gt;Creates a new &lt;code&gt;_Number_&lt;/code&gt; value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Convert string to decimal&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var string = 10.134.toFixed(2); // =&amp;gt; '10.13'var num = Number(string); // =&amp;gt; 10.13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  12 Methods for Finding an Item in an Array (and Array of Objects) in JavaScript
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/12-methods-for-finding-an-item-in-an-array-and-array-of-objects-in-javascript-484a1ba66324"&gt;&lt;strong&gt;12 Methods for Finding an Item in an Array (and Array of Objects) in JavaScript&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, I…_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/12-methods-for-finding-an-item-in-an-array-and-array-of-objects-in-javascript-484a1ba66324"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. How do I loop through or enumerate a JavaScript Object?
&lt;/h3&gt;

&lt;p&gt;Each ECMAScript version comp up with a different way to enumerate the Objects. Let’s check this out.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_Object.keys()_**&lt;/code&gt; method returns an array of a given object's own enumerable property &lt;strong&gt;names&lt;/strong&gt;, iterated in the same order that a normal loop would.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;**_forEach()_**&lt;/code&gt; method executes a provided function once for each array element.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;ES5 (Object.keys() and forEach)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var data = { val1: "abc", val2: "cde" };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Object.keys(data).forEach(function(key) {    console.log(key, obj[key]);});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ES6 (&lt;/strong&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of"&gt;&lt;strong&gt;for...of&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_for...of_**&lt;/code&gt; &lt;strong&gt;statement&lt;/strong&gt; creates a loop iterating over &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol"&gt;iterable objects&lt;/a&gt;, including: built-in &lt;code&gt;[_String_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)&lt;/code&gt;, &lt;code&gt;[_Array_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;/code&gt;, array-like objects (e.g., &lt;code&gt;[_arguments_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)&lt;/code&gt; or &lt;code&gt;[_NodeList_](https://developer.mozilla.org/en-US/docs/Web/API/NodeList)&lt;/code&gt;), &lt;code&gt;[_TypedArray_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)&lt;/code&gt;, &lt;code&gt;[_Map_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)&lt;/code&gt;, &lt;code&gt;[_Set_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)&lt;/code&gt;, and user-defined iterables. It invokes a custom iteration hook with statements to be executed for the value of each distinct property of the object.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const key of Object.keys(data)) {    console.log(key, obj[key]);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ES8&lt;/strong&gt; &lt;code&gt;[**Object.entries()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries)&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_Object.entries()_**&lt;/code&gt; method returns an array of a given object's own enumerable string-keyed property &lt;code&gt;_[key, value]_&lt;/code&gt; pairs, in the same order as that provided by a &lt;code&gt;[_for...in_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in)&lt;/code&gt; loop.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Object.entries(data).forEach(    ([key, value]) =&amp;gt; console.log(key, value));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can combine &lt;code&gt;for...of&lt;/code&gt;, destructuring, and &lt;code&gt;Object.entries&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const [key, value] of Object.entries(data)) {    console.log(key, value);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. What is the difference between event.preventDefault() and return false
&lt;/h3&gt;

&lt;p&gt;with return false, there is a chance that other functions are getting executed which is specifically written inside the click while preventDefault won’t allow executing anything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$('a').click(function (e) {  // logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// runtime error...navigation happened
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return false;});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example of preventDefault()&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$('a').click(function (e) {  e.preventDefault();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// runtime error, naviagation will not happen});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. How can I check for an empty/undefined/null string in JavaScript?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (!!data) {    // Some code here}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use type casting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (Boolean(data)) {    // Code here}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both do the same function. Typecast the variable to Boolean, where &lt;code&gt;str&lt;/code&gt; is a variable.&lt;br&gt;&lt;br&gt;
It returns &lt;code&gt;false&lt;/code&gt; for &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;000&lt;/code&gt;, &lt;code&gt;""&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
It returns &lt;code&gt;true&lt;/code&gt; for string &lt;code&gt;"0"&lt;/code&gt; and whitespace &lt;code&gt;" "&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  If you are looking to Optimize your JavaScript code using modern shorthand techniques, tips, and tricks check out this article.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;&lt;strong&gt;34 JavaScript Optimization Techniques to Know in 2021&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_Optimize your JavaScript code using modern shorthand techniques, tips, and tricks_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  6. How to insert an item into an array at a specific index (JavaScript)?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Append Single Element at a specific index&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Append at index 2array.splice(2, 0,'newData');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Append at index 5array[5] = 'newData';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Append Multiple Element at a specific index&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Append at index 2array.splice(2, 0,'data1', 'data2', 'data3');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. How to Get the current URL with JavaScript?
&lt;/h3&gt;

&lt;p&gt;Use windows function:&lt;code&gt;window.location.href&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Remove Duplicates from an Array or Array of Objects in JavaScript
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-remove-duplicates-from-an-array-or-array-of-objects-in-javascript-9ab417cb9667"&gt;&lt;strong&gt;How to Remove Duplicates from an Array or Array of Objects in JavaScript&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, I…_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-remove-duplicates-from-an-array-or-array-of-objects-in-javascript-9ab417cb9667"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  8. Checking if a key exists in a JavaScript object?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Using &lt;em&gt;in&lt;/em&gt; operator&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let data = "abc" in array;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using hasOwnProperty&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let result = data.hasOwnProperty("abc")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Accessing elements directly (brackets style)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let result = data["abc"] === undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Accessing elements directly (object style)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let result = array.abc === undefined;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9. How to merge two arrays in JavaScript and remove duplicate items?
&lt;/h3&gt;

&lt;p&gt;We do play with arrays in day to day life and there are a lot of requirements where we need to combine arrays as well as need to remove duplicates.&lt;/p&gt;

&lt;p&gt;Below are some approaches to achieve this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1. Using Lodash&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(_.union([10, 4, 5], [134, 26, 19, 10], [6, 1]));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;2. Using Filter and Concat&lt;/em&gt;&lt;/strong&gt;&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 = [56, 43, 3], b = [11, 43, 56, 12]let c = a.concat(b)let d = c.filter((val, pos) =&amp;gt; c.indexOf(val) === pos)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;3. Using Set&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[...new Set([...array1 ,...array2])]; //   =&amp;gt; remove duplication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10. How to check whether a string contains a substring in JavaScript?
&lt;/h3&gt;

&lt;p&gt;We can use the following two methods to achieve this function.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. includes
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_includes()_**&lt;/code&gt; method determines whether an array includes a certain value among its entries, returning &lt;code&gt;_true_&lt;/code&gt; or &lt;code&gt;_false_&lt;/code&gt; as appropriate.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const val1 = "atitpatel";const val2 = "patel";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(string.includes(val2));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. index of
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;**indexOf()**&lt;/code&gt; the method returns the first index at which a given element can be found in the array, or -1 if it is not present.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = "atitpatel";var substr = "patel";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(str.indexOf(substr) !== -1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are looking for array and object-related tips please check out this article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c"&gt;&lt;strong&gt;21 Arrays and Object Tricks in JavaScript/TypeScript&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, I…_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  11. How to replace all occurrences of a string?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;We can use ES6 to handle this.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;str = str.replace(/test/g, '');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;We can use Regex.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;let find = 'ab';&lt;/p&gt;

&lt;p&gt;let re = new RegExp(find, '');&lt;/p&gt;

&lt;p&gt;let str = find.replace(re, 'cd');&lt;/p&gt;

&lt;p&gt;console.log(str);&lt;/p&gt;
&lt;h3&gt;
  
  
  12. How to correctly clone a JavaScript object?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Using ES6&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var val1 = {data: "value"};var val2= Object.assign({}, val1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;If you want a shallow copy&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Object.assign({}, data)&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;For a deep copy&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;JSON.parse(JSON.stringify(data))&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  13. What is the !! (not not) an operator in JavaScript?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;!!&lt;/code&gt; converts the value to the right of it to its equivalent boolean value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!!false === false           !!true === true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              !!0 === false!!parseInt("foo") === false // NaN is falsy              !!1 === true             !!-1 === true  // -1 is truthy          !!(1/0) === true  // Infinity is truthy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             !!"" === false // empty string is falsy          !!"foo" === true  // non-empty string is truthy        !!"false" === true  // ...even if it contains a falsy value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     !!window.foo === false // undefined is falsy           !!null === false // null is falsy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             !!{} === true  // an (empty) object is truthy             !![] === true  // an (empty) array is truthy; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  14. How to Loop through an array in JavaScript
&lt;/h3&gt;

&lt;p&gt;we have several options:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Sequential &lt;code&gt;for&lt;/code&gt; loop:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var array = ["a","b"];var arrayLength = array.length;for (var i = 0; i &amp;lt; arrayLength; i++) {    console.log("value",array[i]);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Array.prototype.forEach
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const data = ["a", "b", "c"];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data.forEach(function (item, index) {  console.log(item, index);});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. ES6 &lt;code&gt;for-of&lt;/code&gt; statement
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let data = ['a', 'b', 'c'];for (const a of data){    console.log(a);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9 Methods for Sorting an Item in an Array (and Array of Objects) in JavaScript
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/9-methods-for-sorting-an-item-in-an-array-and-array-of-objects-in-javascript-8226f5d39590"&gt;&lt;strong&gt;9 Methods for Sorting an Item in an Array (and Array of Objects) in JavaScript&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, I…_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/9-methods-for-sorting-an-item-in-an-array-and-array-of-objects-in-javascript-8226f5d39590"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  15. How do I copy to the clipboard in JavaScript?
&lt;/h3&gt;

&lt;p&gt;We can prompt the user to click and enter by doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function copy(text) {  window.prompt("Copy to clipboard: Ctrl+C, Enter", text);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the clipboard copy operation is SAFE because a user has clicked on the prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button id="data" onclick="copy(document.getElementById('data').innerHTML)"&amp;gt;Copy here&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;  function copy(text) {    window.prompt("To Copy Please do this: Ctrl+C, Enter", text);  }&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://js.plainenglish.io/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;strong&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_JavaScript Coding Assessment Cheatsheet 2021_js.plainenglish.io&lt;/a&gt;&lt;a href="https://js.plainenglish.io/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  16. How do I test for an empty JavaScript object?
&lt;/h3&gt;

&lt;p&gt;There are several ways to achieve this function.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://api.jquery.com/jQuery.isEmptyObject/"&gt;1.jQuery&lt;/a&gt;:
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jQuery.isEmptyObject({}); // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://lodash.com/docs#isEmpty"&gt;2. lodash&lt;/a&gt;:
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_.isEmpty({}); // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://underscorejs.org/#isEmpty"&gt;3. Underscore&lt;/a&gt;:
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_.isEmpty({}); // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  17. How do I make the first letter of a string uppercase in JavaScript?
&lt;/h3&gt;

&lt;p&gt;We can either update the CSS which has text-transform property.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;In CSS:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p:first {    text-transform:capitalize;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Using function we can call toUpperCase() method.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function makeUpperCase(val){    return val &amp;amp;&amp;amp; val[0].toUpperCase() + val.slice(1);}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  18. How can I change an element’s class with JavaScript?
&lt;/h3&gt;

&lt;p&gt;There are a lot of requirements where we need to change some color or CSS based on conditions.&lt;/p&gt;

&lt;p&gt;How it can be done in JavaScript?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To change all classes for an element:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To replace all existing classes with one or more new classes, set the className attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("test").className = "newclass";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;To add an additional class to an element:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To add a class to an element, without removing/affecting existing values, append a space and the new class name, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("test").className += " newClass";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;To remove a class from an element:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To remove a single class to an element, without affecting other potential classes, a simple regex replace is required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("test").className =   document.getElementById("test").className.replace      ( /(?:^|\s)newClass(?!\S)/g , '' )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  19. Is it possible to apply CSS to half of a character?
&lt;/h3&gt;

&lt;p&gt;We do see some fancy word art where the half of the character have different color while other half have different color. How we can achieve something like this in CSS?&lt;/p&gt;

&lt;p&gt;Below is the example to make apply CSS for half character.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {  display: inline-block;  margin: 0; /* for demo snippet */  line-height: 1em; /* for demo snippet */  font-family: helvetica, arial, sans-serif;  font-weight: bold;  font-size: 300px;  background: linear-gradient(to right, #7db9e8 50%,#1e5799 50%);  -webkit-background-clip: text;  -webkit-text-fill-color: transparent;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;XYZ&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  20. How to append something to an array?
&lt;/h3&gt;

&lt;p&gt;In the older JavaScript version, it was done by using the apply method.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;**_apply()_**&lt;/code&gt; method calls a function with a given &lt;code&gt;_this_&lt;/code&gt; value, and &lt;code&gt;_arguments_&lt;/code&gt; provided as an array (or an &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections#Working_with_array-like_objects"&gt;array-like object&lt;/a&gt;).&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array1 = [33, 45, 5];let array2 = [100, 2];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Array.prototype.push.apply(array2, array1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(array2); // [100, 2, 33, 45, 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With ES6 it can be done using the spread operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array1 = [11, 42, 53];let array2 = [1, 2];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array2.push(...array1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(array2); // [11, 2, 3, 42, 53]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://js.plainenglish.io/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3a82c53d051e"&gt;&lt;strong&gt;Continue reading&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Send data through routing paths in Angular</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Mon, 22 Feb 2021 00:50:40 +0000</pubDate>
      <link>https://dev.to/patelatit53/how-to-send-data-through-routing-paths-in-angular-51fp</link>
      <guid>https://dev.to/patelatit53/how-to-send-data-through-routing-paths-in-angular-51fp</guid>
      <description>&lt;h4&gt;
  
  
  Daily Angular Tips, Tricks, and Best Practices: Part 9
&lt;/h4&gt;

&lt;p&gt;As a developer, there is no limit to learning. We always need to be up to date with technologies as well as the upcoming or current features which are trending in the market.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S4PL01ZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AdSsBs1Om1ZDFdP7R" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S4PL01ZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AdSsBs1Om1ZDFdP7R" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@benwhitephotography?utm_source=medium&amp;amp;utm_medium=referral"&gt;Ben White&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently, I was looking for the best techniques to write clean and optimize my angular code. I have gone through a lot of articles, and as we know, it is limitless. Then I thought of consolidating the checklist with different Basic Angular Topics which helped me and might help others too in the future.&lt;/p&gt;

&lt;p&gt;These small articles not only help you to write a better and clean Angular Code but also clear the concepts of front-end technologies. This will help you to build your strong base and can help you in the upcoming frontend interviews.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let’s move towards our main discussion.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Passing data between components&lt;/strong&gt; is one of the common tasks which we do in frontend development. Sometimes when we don’t have state maintained in our application we can use the angular router feature to pass the data between the components.&lt;/p&gt;

&lt;p&gt;We can achieve this like this using &lt;code&gt;@angular/router&lt;/code&gt;which does support the route state and &lt;strong&gt;navigationExtras&lt;/strong&gt;, which takes an object literal similar to &lt;code&gt;queryParams&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s checkout different approaches to achieve this functions.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Using Required Routing Parameters:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UVfMvexd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A9VnxfbDm2CDZ8eByqEIYuw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UVfMvexd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A9VnxfbDm2CDZ8eByqEIYuw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Using Route Optional Parameters:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nuSchGVm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AWiKZhSjxsuXflAuid3ZEDw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nuSchGVm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AWiKZhSjxsuXflAuid3ZEDw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Using Route Query Parameters:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4tfu88Y0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_BzgoZ2GTzD3dVtDiQcWcA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4tfu88Y0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_BzgoZ2GTzD3dVtDiQcWcA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Using Route &lt;strong&gt;NavigationExtras&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dLqYPK7---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A3w0ZUEoys1TThKHS_GxCDg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dLqYPK7---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A3w0ZUEoys1TThKHS_GxCDg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s always better to see practicals instead of theory. No issue. I have a practical example ready for you. Check out here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackblitz.com/edit/angular-route-parameters-tu8g9e"&gt;https://stackblitz.com/edit/angular-route-parameters-tu8g9e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you missed previous parts checkout below:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/dev-basics/angular-daily-tips-and-tricks-cf1574fb67bc"&gt;What is the difference between constructor and ngOnInit?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://Explain%20how%20Angular%20application%20loads/Initialize."&gt;Explain how Angular application loads/Initialize.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/dev-basics/daily-angular-tips-tricks-and-best-practices-3-239a7b442c7f"&gt;Explain the digest cycle/Change detection Cycle in Angular.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/what-is-the-difference-between-declarations-providers-and-imports-7269e3707920"&gt;What is the difference between declarations, providers, and imports?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://What%20is%20the%20difference%20between%20BehaviourSubject,%20Subject,%20ReplaySubject%20and%20Async%20Subject?"&gt;What is the difference between BehaviourSubject, Subject, ReplaySubject and Async Subject?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-detect-changes-when-an-angular-component-is-using-input-d422af6ddd2a"&gt;How To Detect Changes When An Angular Component Is Using ‘@input’&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>angular</category>
      <category>typescript</category>
    </item>
    <item>
      <title>ES12 Features you should know in 2021</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Mon, 22 Feb 2021 00:47:46 +0000</pubDate>
      <link>https://dev.to/patelatit53/es12-features-you-should-know-in-2021-394a</link>
      <guid>https://dev.to/patelatit53/es12-features-you-should-know-in-2021-394a</guid>
      <description>&lt;h4&gt;
  
  
  Optimize your JavaScript Code with new ES2021 Features
&lt;/h4&gt;

&lt;p&gt;The future of JavaScript is going to be brilliant. Keeping up with the changes shouldn’t be harder than it already is, and my motive is to introduce all the JavaScript best practices such as shorthand and features which we must know as a frontend developer to make our life easier in 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GFr1WXCb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2Ay2lcxe3MPAHI63c8" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GFr1WXCb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2Ay2lcxe3MPAHI63c8" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@benwhitephotography?utm_source=medium&amp;amp;utm_medium=referral"&gt;Ben White&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might be doing JavaScript development for a long time but sometimes you might be not updated with the newest features which can solve your issues without doing or writing some extra codes. These techniques can help you to write clean and optimized JavaScript Code. Moreover, these topics can help you to prepare yourself for JavaScript interviews in 2021.&lt;/p&gt;

&lt;p&gt;Here I am coming with a new series to cover all JavaScript features (with versions) that help you to write more clean and optimized JavaScript Code. This is a &lt;strong&gt;Cheat list for JavaScript&lt;/strong&gt; Coding you must know in 2021.&lt;/p&gt;

&lt;p&gt;Let’s understand these features &lt;strong&gt;ES2021&lt;/strong&gt; features with examples.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. replaceAll
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;replaceAll&lt;/strong&gt;() method returns a new string with all matches of a &lt;em&gt;pattern&lt;/em&gt; replaced by the &lt;em&gt;new replacement word&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The Pattern can be &lt;strong&gt;string&lt;/strong&gt; or &lt;strong&gt;Regexp&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;const p = 'my name is atit';&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const regex = /atit/gi;

console.log(p.replaceAll(regex, 'patel'));  
// expected output: my name is patel

console.log(p.replaceAll('atit', 'patel'));  
// expected output: my name is patel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  2. Promise.any()
&lt;/h4&gt;

&lt;p&gt;It takes an iterable of Promise objects and as one promise fulfills, return a single promise with the value.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const promise1 = Promise.reject(0);

const promise2 = new Promise((resolve) =&amp;gt; setTimeout(resolve, 50, 'fast'));

const promise3 = new Promise((resolve) =&amp;gt; setTimeout(resolve, 100, 'slow'));

const promises = [promise1, promise2, promise3];

Promise.any(promises).then((value) =&amp;gt; console.log(value)); //fast
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  3. Weakref
&lt;/h4&gt;

&lt;p&gt;This object holds a weak reference to another object without preventing that object from getting garbage-collected.&lt;/p&gt;

&lt;p&gt;For example checkout below link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef"&gt;&lt;strong&gt;WeakRef&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_A WeakRef object lets you hold a weak reference to another object, without preventing that object from getting…_developer.mozilla.org&lt;/a&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  4. FinalizationRegistry
&lt;/h4&gt;

&lt;p&gt;Lets you request a callback when an object is garbage collected.&lt;/p&gt;

&lt;p&gt;For example checkout below link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry"&gt;&lt;strong&gt;FinalizationRegistry&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_A FinalizationRegistry object lets you request a callback when an object is garbage-collected. FinalizationRegistry…_developer.mozilla.org&lt;/a&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  5. Private visibility modifier for methods and accessors
&lt;/h4&gt;

&lt;p&gt;Class properties are public by default and can be examined or modified outside the class. There is however &lt;a href="https://github.com/tc39/proposal-private-methods"&gt;a stage 3 proposal&lt;/a&gt; to allow defining private class fields using a hash &lt;code&gt;#&lt;/code&gt; prefix.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class TestClass {  
  #privateVariable  
}

class TestClass {  
  #privateMethod() {  
    return 'test'  
  }  
}

class TestClass {  
  static #PRIVATE_STATIC_FIELD  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  6. Logical Operators
&lt;/h4&gt;

&lt;p&gt;The logical OR assignment (x ||= y) operator only assigns if x is false.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const a = { duration: 50, title: '' };

a.duration ||= 10;  
console.log(a.duration);  
// expected output: 50

a.title ||= 'title is empty.';  
console.log(a.title);  
// expected output: "title is empty"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The logical AND assignment (x &amp;amp;&amp;amp;= y) operator only assigns if x is truthy.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 1;  
let b = 0;

a &amp;amp;&amp;amp;= 2;  
console.log(a);  
// expected output: 2

b &amp;amp;&amp;amp;= 2;  
console.log(b);  
// expected output: 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  7. Numeric Separators
&lt;/h4&gt;

&lt;p&gt;This is the feature that helps us to relieve some pain while reading large numbers.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const value = 1000000000000;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a feature in JavaScript that enables underscore as a separator in numeric literals to improve readability.&lt;/p&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 value = 1_000_000_000_000;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use this for binary, octal, and hex numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const n1 = 0b1010_0101_1001; // binaryconst n2 = 0o2_3_5_7; // octalconst n3 = 0xA_B_C_D_E; // hex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  8. Intl.ListFormat
&lt;/h4&gt;

&lt;p&gt;This object enables language-sensitive list formatting.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const data = ['abc', 'test', 'cde'];

const formatter1 = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' });  
console.log(formatter.format(data));  
// expected output: "abc, test, and cde"

const formatter2 = new Intl.ListFormat('en', { style: 'narrow', type: 'unit' });  
console.log(formatter3.format(data));  
// expected output: "abc test cde"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  9. Intl.DateTimeFormat
&lt;/h4&gt;

&lt;p&gt;This object enables the language-sensitive date and time formatting.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Specify default date formatting for language (locale)  
console.log(new Intl.DateTimeFormat('en-US').format(date));  
// expected output: "01/04/2021"

// Specify date and time format using "style" options (i.e. full, long, medium, short)  
console.log(new Intl.DateTimeFormat('en-GB', { dateStyle: 'full', timeStyle: 'long' }).format(date));  
// Expected output "Monday, 04 January 2021 at 14:23:16 GMT+11"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;If you are looking to Optimize your JavaScript code using modern shorthand techniques, tips, and tricks check out this article.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;&lt;strong&gt;34 JavaScript Optimization Techniques to Know in 2021&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
_Optimize your JavaScript code using modern shorthand techniques, tips, and tricks_medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3a82c53d051e"&gt;42 Tips and Tricks to Write Faster, Better-Optimized JavaScript Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/25-tips-and-tricks-to-write-faster-better-optimized-typescript-code-c1826cf4730e"&gt;25 Tips and Tricks to Write Faster, Better-Optimized TypeScript Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c"&gt;21 Arrays and Object Tricks in JavaScript/TypeScript&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;34 JavaScript Optimization Techniques to Know in 2021&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/100-coding-terms-and-definitions-every-developer-should-know-be22447b7579"&gt;100 Coding Terms and Definitions Every Developer Should Know&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/20-useful-vs-code-extensions-for-frontend-developers-in-2021-8f0c6c5c9e50"&gt;20 Useful VS Code Extensions for Frontend Developers&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>30 Friday Stress Relievers For Programmers</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Fri, 19 Feb 2021 14:38:57 +0000</pubDate>
      <link>https://dev.to/patelatit53/30-friday-stress-relievers-for-programmers-3dmk</link>
      <guid>https://dev.to/patelatit53/30-friday-stress-relievers-for-programmers-3dmk</guid>
      <description>&lt;p&gt;&lt;a href="https://js.plainenglish.io/30-friday-stress-relievers-for-programmers-fbcfede676f7?source=rss-795bd33d705------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UJu4liiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/600/0%2Apr7K27UyYDYADsdJ" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why programmers don’t Have Fun?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://js.plainenglish.io/30-friday-stress-relievers-for-programmers-fbcfede676f7?source=rss-795bd33d705------2"&gt;Continue reading»&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>jokes</category>
      <category>react</category>
    </item>
    <item>
      <title>Top 100 Questions You Must Prepare For Your Next Angular Interview (1–45)</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Thu, 18 Feb 2021 16:26:51 +0000</pubDate>
      <link>https://dev.to/patelatit53/top-100-questions-you-must-prepare-for-your-next-angular-interview-1-45-59ln</link>
      <guid>https://dev.to/patelatit53/top-100-questions-you-must-prepare-for-your-next-angular-interview-1-45-59ln</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4z-F7WCv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjpzn9s8n1lnffnsjqww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4z-F7WCv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjpzn9s8n1lnffnsjqww.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently, I was trying to prepare myself for the upcoming interviews and it was a bit tough to search in google and open link and see same questions each and every time so I thought of sharing what I have found and what is most common questions someone should know if they are preparing for an interview.&lt;/p&gt;

&lt;p&gt;Below are the most common interview questions asked in Latest Angular Interviews. These Angular Interview questions and answers help to prepare for Angular developer interviews from junior to senior levels. Moreover, this article covers the basics to advance angular interview questions which you must prepare in 2021.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What is the difference between constructor and ngOnInit?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What is the difference between components and directives?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. What is the difference between ElementRef, TemplateRef, and viewContainerRef?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. What is the difference between ng-content,ng-template, and ng-container?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What is the difference between view-child and content-child?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What is the difference between component view, host view, and embedded view?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. What is the difference between debounce time and throttle time?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. What is the difference between forEach and map?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. What is the difference between ng-content and ng-templateoutlet?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. What is the difference between forchild vs forroot?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Why we use pipe operators in RXJS. What is the use of it?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. What is the difference between using the Async pipe vs the subscribe function in the Angular application?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. What is the difference between promise and observable?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. What is the difference between Event Emitter and Subjects?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. What is the difference between Observable and Subject?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. What is the difference between Activated Route vs Activated route Snapshot?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. Discuss different kinds of loading strategies used in your Angular application.&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. What is Metadata?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19. What is routerlinkActive use for?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. Where we use generics in Angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21. What is the wild card route?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22. What is the difference between ngIf and hidden?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;23. What is a router outlet?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24. What is the Router state?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25. What is an Active route?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;26. Explain different injections in angular.&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;27. What is the best way to implement translations in angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;28. Explain different routing params in Angular.&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;29. What is a virtual scroll in Angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;30. What is the difference between route param vs query param?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;31. Explain different guards supported in Angular.&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;32. What is the best way too lazy load the component?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;33. What is the way we can display the app version in Angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;34. What are the generators in ES6?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;35. Explain the Error mechanism in your application.&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;36. What is bootstrapping in angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;37. What are Angular elements? why we use it?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;38. What is the difference between the arrow function and regular functions?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;39. What is the difference between Functional vs Object Oriented Programming language? Which one you prefer and why?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;40. What is the difference between JavaScript and TypeScript?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;41. What do you know about Closures?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;42. What is the difference between Template Driven forms and Reactive Forms?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;43. What are different Kinds of Bindings possible in Angular?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;44. Which RXJS operators used for transforming or manipulating data?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;45. Which RXJS Operators you use mostly to handle HTTP services?&lt;/strong&gt;&lt;br&gt;
Check out the answer &lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  To check out the answers for 1–45 questions please check the below article.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d"&gt;https://medium.com/javascript-in-plain-english/tricky-interview-questions-in-angular-2020-part-3-659c0bc81a9d&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>How to Set Values in Reactive Forms</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Thu, 18 Feb 2021 16:01:05 +0000</pubDate>
      <link>https://dev.to/patelatit53/how-to-set-values-in-reactive-forms-1a2d</link>
      <guid>https://dev.to/patelatit53/how-to-set-values-in-reactive-forms-1a2d</guid>
      <description>&lt;h1&gt;
  
  
  Daily Angular Tips, Tricks, and Best Practices: Part 8
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-set-values-in-reactive-forms-44ca830d36bf?source=rss-795bd33d705------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kimgd4w6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1941/1%2A35jC4Htvr0T1KIU5_DJKGQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a developer, there is no limit to learning. We always need to be up to date with technologies as well as the upcoming or current features which are trending in the market.&lt;/p&gt;

&lt;p&gt;Recently, I was looking for the best techniques to write clean and optimize my angular code. I have gone through a lot of articles, and as we know, it is limitless. Then I thought of consolidating the checklist with different Basic Angular Topics which helped me and might help others too in the future.&lt;/p&gt;

&lt;p&gt;These small articles not only help you to write a better and clean Angular Code but also clear the concepts of front-end technologies. This will help you to build your strong base and can help you in the upcoming frontend interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s move towards our main discussion.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most basic topics in any programming is creating forms and validate them. In Reactive forms when data comes from the backend or we might need to set the form values, we can achieve this by following different approaches. Let’s see how we can set the value to forms?&lt;/p&gt;

&lt;p&gt;We can use the following methods to update the value of a reactive form control.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Methods using setValue()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Methods using patchValue()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can update multiple controls in the form group if required using the PatchValue&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can use the set value by mapping the exact same JSON as a form group&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we have form array to patch values&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-set-values-in-reactive-forms-44ca830d36bf?source=rss-795bd33d705------2"&gt;To see practical example in details checkout here »&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>angular</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How I earned money from writing and went $0.55 to $2,200+ in 3 Months
</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 17 Feb 2021 05:45:58 +0000</pubDate>
      <link>https://dev.to/patelatit53/how-i-earned-money-from-writing-in-medium-and-went-0-55-to-2-200-in-3-months-4n2l</link>
      <guid>https://dev.to/patelatit53/how-i-earned-money-from-writing-in-medium-and-went-0-55-to-2-200-in-3-months-4n2l</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fNqgf3M0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AwvYvYTeyIrI6AZgL" class="article-body-image-wrapper"&gt;&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--fNqgf3M0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AwvYvYTeyIrI6AZgL"&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;amp;utm_medium=referral" class="markup--anchor markup--figure-anchor" rel="photo-creator noopener"&gt;Markus Winkler&lt;/a&gt; onÂ &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" class="markup--anchor markup--figure-anchor" rel="photo-source noopener"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;p id="5c4e" class="graf graf--p graf-after--figure"&gt;Like everyone else, I started my Medium journey by reading different blogs. I bought a Medium subscription in July as I was restricted to read more stories.&lt;/p&gt;
&lt;p id="2185" class="graf graf--p graf-after--p"&gt;When I joined Medium I had &lt;strong class="markup--strong markup--p-strong"&gt;no intentions&lt;/strong&gt; of trying to earn money from Medium and honestly speaking I had no clue about the Medium writing program. Crazy right?&lt;/p&gt;
&lt;p id="287e" class="graf graf--p graf-after--p"&gt;I was an Angular Developer for X years and wanted to change my career so I started exploring the latest trends in Frontend Technologies. I started preparing for different questions and Medium was helping me to go through different topics in depth. After 35 days of preparations, I was able to get my dream job as a Senior Consultant in One Company.&lt;/p&gt;
&lt;p id="ec5b" class="graf graf--p graf-after--p"&gt;One day suddenly I came across one topic about someoneâ€™s journey of earning some amount from the Medium and it motivated me to write and share my research and experiences about topics that most interviewers ask in Angular Interviews.&lt;/p&gt;
&lt;p id="91c7" class="graf graf--p graf-after--p"&gt;This was the first article I wrote in the Medium.&lt;em class="markup--em markup--p-em"&gt; (Note: I have recently changed title)&lt;/em&gt;&lt;/p&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/basic-to-tricky-interview-questions-in-angular-2020-part-1-c55a6b2b8d05" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/basic-to-tricky-interview-questions-in-angular-2020-part-1-c55a6b2b8d05"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;Advanced Angular interview questions you must prepare in 2021&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Part 1&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/basic-to-tricky-interview-questions-in-angular-2020-part-1-c55a6b2b8d05" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;p id="8ec2" class="graf graf--p graf-after--mixtapeEmbed"&gt;I have received &lt;strong class="markup--strong markup--p-strong"&gt;1 view/day&lt;/strong&gt; after posting this article. I was so happy after seeing that someone is reading my article.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--mUbPo2hA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AXcGX8eQwOwNLKFjCGmKvYg.png"&gt;&lt;p id="79ae" class="graf graf--p graf-after--figure"&gt;After writing one article, I started researching how I can share this article with others and how I can enhance my views and basically make more money.&lt;/p&gt;
&lt;p id="7f3a" class="graf graf--p graf-after--p"&gt;I have read a lot of articles so I got the idea of which kind of the content reader wants to read and which motivates them to read my articles. I started with my Interview Questions and I started writing about different topics such as the basics of Angular, Optimization, and Performance Techniques.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--1hQpKafL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AK9He9bHFs7BE0pjRpYIFCg.png"&gt;&lt;strong class="markup--strong markup--figure-strong"&gt;9942 views/day on JanuaryÂ 15&lt;/strong&gt;&lt;p id="8a00" class="graf graf--p graf-after--figure"&gt;When I got $0.55 USD in my bank I have decided next time I will make more for sure.&lt;/p&gt;
&lt;p id="f587" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;My first month earnings:&lt;/strong&gt;&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--_CXXAQFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AQ-LGpUc9j-77iZga5qNGuA.png"&gt;&lt;p id="2d82" class="graf graf--p graf-after--figure"&gt;One day I got contacted by one publication to publish my story to their publication. After publishing the story my views got increased and I found a new way to improve the views by publishing stories to publications.&lt;/p&gt;
&lt;p id="55cc" class="graf graf--p graf-after--p"&gt;I started writing more and more which helped me to learn and adapt to different styles. Next month I earned $120.98 and then went to $670.71.&lt;/p&gt;
&lt;p id="a5b6" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;Below are different monthâ€™s earning details:&lt;/strong&gt;&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--sBA1vhJO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AteR8P6EIO-JqWVk6-1Kptg.png"&gt;&lt;h3 id="68f7" class="graf graf--h3 graf-after--figure"&gt;Tips&lt;/h3&gt;
&lt;p id="c2c0" class="graf graf--p graf-after--h3"&gt;Below are the things I started considering in my Medium journey and this formula helped me to reach my goals.&lt;/p&gt;
&lt;h4 id="2a56" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;1. Publications&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="bed3" class="graf graf--p graf-after--h4"&gt;As Publications have a lot of followers it helps us to build audience and views.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--sJ8hfCU1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AM6_5G-0cc3ROeHvOEPnwXw.png"&gt;&lt;h4 id="fc77" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;2. Social Media and Promotions&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="1176" class="graf graf--p graf-after--h4"&gt;Social media helps a lot to improve your article views. What I learned is donâ€™t afraid to share your work with the world. People may laugh but you will learn a lot eventually.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--vZYs3yC6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2ANGJPZ-UNrVUeFOCD57LLzA.png"&gt;&lt;h4 id="2124" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;3. Title&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="d90a" class="graf graf--p graf-after--h4"&gt;I have found from a lot of research that the title should be more appealing for users to read your article.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--V33yzEld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A4VdEn5opWmgVNcISxETUUw.png"&gt;&lt;h4 id="6fdc" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;4. Content andÂ SEO&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="b95e" class="graf graf--p graf-after--h4"&gt;What I found while searching in Google that when you search for a specific word sometimes Google picks your content word in the match.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--t2KjLv3K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AQyeMMzi8aErkBainyF5F6w.png"&gt;&lt;h4 id="68f8" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;5. Start WritingÂ More&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="a8cb" class="graf graf--p graf-after--h4"&gt;What I learn if you write more, you get an idea of how you can improve your writing skills as well as how you can engage more users.&lt;/p&gt;
&lt;p id="0f5c" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;Below are the numbers.&lt;/em&gt;&lt;/p&gt;
&lt;p id="195f" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;September: &lt;/strong&gt;1 Story&lt;br&gt;&lt;strong class="markup--strong markup--p-strong"&gt;October: &lt;/strong&gt;23 Stories&lt;br&gt;&lt;strong class="markup--strong markup--p-strong"&gt;November:&lt;/strong&gt; 34 Stories&lt;br&gt;&lt;strong class="markup--strong markup--p-strong"&gt;December:&lt;/strong&gt; 21 Stories&lt;br&gt;&lt;strong class="markup--strong markup--p-strong"&gt;January:&lt;/strong&gt; 20+ Stories&lt;/p&gt;
&lt;h4 id="8491" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;6. SupportÂ Others&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="224a" class="graf graf--p graf-after--h4"&gt;Start appreciating other's work. This can help you make friends in Medium.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZDzXgXPR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AyBE3ZYOT5OxJqF-QAis4qg.png"&gt;&lt;h4 id="0ac3" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;7. FacebookÂ groups&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="4bd3" class="graf graf--p graf-after--h4"&gt;You can learn a lot from other groups about writing in Medium. Below are some groups: &lt;a href="https://www.facebook.com/groups/mediumwriting/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Medium Writing&lt;/a&gt; &lt;a href="https://www.facebook.com/groups/mediumwriterslounge/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Medium Writers Lounge&lt;/a&gt;, M&lt;a href="https://www.facebook.com/groups/writersnbloggers/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;edium Writers and Bloggers&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="3e0b" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;8. Donâ€™t expect success rightÂ away&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="aae5" class="graf graf--p graf-after--h4"&gt;Don't be upset about your work if it is not getting more views or curated. Good things take time.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--fa0pXHT6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2Aa_0Ur6J_p-JWlS5fnKOw8g.png"&gt;&lt;h4 id="4796" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;9. User ProperÂ tags&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="82e6" class="graf graf--p graf-after--h4"&gt;It is better to use proper tags to get an idea to see the stories related to tags.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--nu4-nL81--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A-1B7gKWPrxaqjr1OWu16uw.png"&gt;&lt;h4 id="e22b" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;10. Formatting&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="3202" class="graf graf--p graf-after--h4"&gt;If you read a lot of articles you will find the success of stories depends on how they formatted and how it is conveying messages to users. For example, this format helped me a lot: &lt;em class="markup--em markup--p-em"&gt;Introduction, Image, Content, Summary, Source, Recommendations.&lt;/em&gt;&lt;/p&gt;
&lt;p id="8a63" class="graf graf--p graf-after--p"&gt;JavaScript In Plain English has a Style Guide which can help you a lot with this. Link below:&lt;/p&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/how-to-write-articles-that-people-want-to-read-6e661edb6d06" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/how-to-write-articles-that-people-want-to-read-6e661edb6d06"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;How to write articles that people want to read&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Here are a list of recommendations that the â€˜In Plain Englishâ€™ team consider to be best practices when writing articlesâ€¦&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/how-to-write-articles-that-people-want-to-read-6e661edb6d06" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h4 id="8aae" class="graf graf--h4 graf-after--mixtapeEmbed"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;11. Images&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="cd94" class="graf graf--p graf-after--h4"&gt;Yeah! Images can help a lot. You can use &lt;a href="https://unsplash.com/" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener noopener"&gt;Unsplash&lt;/a&gt;.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--tacMr8mY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2ANXpaS59-YvYGMbq1q9oLCw.png"&gt;Example: &lt;a href="https://medium.com/javascript-in-plain-english/13-methods-to-remove-filter-an-item-in-an-array-and-array-of-objects-in-javascript-2211216790d5" class="markup--anchor markup--figure-anchor" rel="nofollow"&gt;&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/13-methods-to-remove-filter-an-item-in-an-array-and-array-of-objects-in-javascript-2211216790d5"&gt;&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/13-methods-to-remove-filter-an-item-in-an-array-and-array-of-objects-in-javascript-2211216790d5"&gt;https://medium.com/javascript-in-plain-english/13-methods-to-remove-filter-an-item-in-an-array-and-array-of-objects-in-javascript-2211216790d5&lt;/a&gt;&lt;h4 id="3518" class="graf graf--h4 graf-after--figure"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;12. Modify yourÂ stories&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="1e4a" class="graf graf--p graf-after--h4"&gt;There might be chances that the stories that have not gained enough views, in the beginning, can get success now. You can modify the content and republish your stories with newer content and ideas to gain more attention.&lt;/p&gt;
&lt;h4 id="9938" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;13. Schedule your PublishÂ times&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="1dff" class="graf graf--p graf-after--h4"&gt;I have seen a couple of times if I publish my story in the morning people tend to read more compare to other times. You can schedule a specific time to publish your stories.&lt;/p&gt;
&lt;h4 id="caa7" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;14. Publish Story Next day after a quickÂ read&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="9594" class="graf graf--p graf-after--h4"&gt;I found this strategy very helpful to find any mistakes in my story. If I publish the same day there are chances I donâ€™t see any errors as I am in hurry to publish my story. This can be avoided by publishing a story on the next day after reviewing it with a fresh mind.&lt;/p&gt;
&lt;h4 id="6ef1" class="graf graf--h4 graf-after--p"&gt;&lt;strong class="markup--strong markup--h4-strong"&gt;15. Spelling mistakes &amp;amp;Â Grammar&lt;/strong&gt;&lt;/h4&gt;
&lt;p id="65f4" class="graf graf--p graf-after--h4"&gt;You can use&lt;strong class="markup--strong markup--p-strong"&gt; Grammarly &lt;/strong&gt;which helps me a lot to correct my spellings.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--_1MBIcaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2ApsK2cfgddWtSe79uvNdjPw.png"&gt;&lt;h4 id="5acc" class="graf graf--h4 graf-after--figure"&gt;So what you are waitingÂ for?&lt;/h4&gt;
&lt;p id="87ea" class="graf graf--p graf--startsWithDoubleQuote graf-after--h4"&gt;&lt;em class="markup--em markup--p-em"&gt;â€œSuccess will never be a big step in the future, success is a small step taken just now.â€ &lt;/em&gt;â€• &lt;strong class="markup--strong markup--p-strong"&gt;Jonatan MÃ¥rtensson&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote id="8514" class="graf graf--pullquote graf-after--p"&gt;I would like to thank &lt;a href="http://medium.com/javascript-in-plain-english" class="markup--anchor markup--pullquote-anchor"&gt;JavaScript In Plain English&lt;/a&gt;, and &lt;a href="https://medium.com/u/a7b125868703" class="markup--user markup--pullquote-user"&gt;Sunil Sandhu&lt;/a&gt; for guiding me and supporting me in thisÂ journey.&lt;/blockquote&gt;
&lt;blockquote id="bb9a" class="graf graf--blockquote graf-after--pullquote"&gt;Checkout some of my popular articles.&lt;/blockquote&gt;
&lt;h3 id="3942" class="graf graf--h3 graf-after--blockquote"&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;22 Utility Functions To Ace Your JavaScript Coding Interview&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;JavaScript Coding Assessment Cheatsheet 2021&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="70f8" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;30 Programming Memes That Will Lighten YourÂ Mood&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/30-programming-memes-that-will-lighten-your-mood-part-2-5946d8b7d3cd" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/30-programming-memes-that-will-lighten-your-mood-part-2-5946d8b7d3cd"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;30 Programming Memes That Will Lighten Your Mood&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Part 2: It was so popular we had to make a Part 2!&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/30-programming-memes-that-will-lighten-your-mood-part-2-5946d8b7d3cd" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="e280" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;51 JavaScript Features covered from ES12 to ES5 you might not knowÂ yet&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-47ae27b46133" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-47ae27b46133"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;51 JavaScript Features covered from ES12 to ES5 you might not know yet&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;51 techniques to optimize and clean your code&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/51-javascript-features-covered-from-es12-to-es5-you-might-not-know-yet-47ae27b46133" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="9982" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;34 JavaScript Optimization Techniques to Know inÂ 2021&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;34 JavaScript Optimization Techniques to Know in 2021&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Optimize your JavaScript code using modern shorthand techniques, tips, and tricks&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/34-javascript-optimization-techniques-to-know-in-2021-d561afdf73c3" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="d2de" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;Angular Interview Questions 2021&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/top-100-questions-you-must-prepare-for-your-next-angular-interview-fcd344ca822e" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/top-100-questions-you-must-prepare-for-your-next-angular-interview-fcd344ca822e"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;Top 100 Questions You Must Prepare For Your Next Angular Interview&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Angular Interview Questions 2021-Part 2&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/top-100-questions-you-must-prepare-for-your-next-angular-interview-fcd344ca822e" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="2234" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;21 Arrays and Object Tricks in JavaScript/TypeScript&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;21 Arrays and Object Tricks in JavaScript/TypeScript&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;I always used to prefer something like a newspaper which give enough information in a shorter span of time. Here, Iâ€¦&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/21-arrays-and-object-tricks-in-javascript-typescript-9d41f5f4966c" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="0322" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;25 Tips and Tricks to Write Faster, Better-Optimized TypeScript Code&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/25-tips-and-tricks-to-write-faster-better-optimized-typescript-code-c1826cf4730e" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/25-tips-and-tricks-to-write-faster-better-optimized-typescript-code-c1826cf4730e"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;25 Tips and Tricks to Write Faster, Better-Optimized TypeScript Code&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Optimize your TypeScript code using modern techniques, tips, and tricks&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/25-tips-and-tricks-to-write-faster-better-optimized-typescript-code-c1826cf4730e" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="9ba3" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;42 Tips and Tricks to Write Faster, Better-Optimized JavaScript Code&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3a82c53d051e" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3a82c53d051e"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;42 Tips and Tricks to Write Faster, Better-Optimized JavaScript Code&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Optimize your JavaScript code using modern techniques, tips, and tricks&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/42-tips-and-tricks-to-write-faster-better-optimized-javascript-code-3a82c53d051e" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="383d" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;8 Reusable Functions To Make Your Angular App Accessible&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/8-reusable-functions-to-make-your-angular-app-accessible-61a870026538" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/8-reusable-functions-to-make-your-angular-app-accessible-61a870026538"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;8 Reusable Functions To Make Your Angular App Accessible&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Angular Accessibility Part 3&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/8-reusable-functions-to-make-your-angular-app-accessible-61a870026538" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;h3 id="31df" class="graf graf--h3 graf-after--mixtapeEmbed"&gt;Understanding Memory Leaks inÂ Angular&lt;/h3&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/understanding-memory-leaks-in-angular-4a738f7ce90d" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://medium.com/javascript-in-plain-english/understanding-memory-leaks-in-angular-4a738f7ce90d"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;Understanding Memory Leaks in Angular&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;Angular Performance and Optimization Checklist&lt;/em&gt;medium.com&lt;/a&gt;&lt;a href="https://medium.com/javascript-in-plain-english/understanding-memory-leaks-in-angular-4a738f7ce90d" class="js-mixtapeImage mixtapeImage u-ignoreBlock"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>22 Utility Functions To Ace Your JavaScript Coding Interview</title>
      <dc:creator>Atit Patel</dc:creator>
      <pubDate>Wed, 17 Feb 2021 05:06:15 +0000</pubDate>
      <link>https://dev.to/patelatit53/22-utility-functions-to-ace-your-javascript-coding-interview-ghg</link>
      <guid>https://dev.to/patelatit53/22-utility-functions-to-ace-your-javascript-coding-interview-ghg</guid>
      <description>&lt;h2&gt;
  
  
  JavaScript Coding Assessment Cheatsheet 2021
&lt;/h2&gt;


&lt;p id="2faa" class="graf graf--p graf-after--h4"&gt;One type of JavaScript coding interview question you might encounter will involve you writing 1–2 lines of code for a given question. These questions are usually simple enough to answer in 5 minutes, but sometimes we struggle with them due to the pressure of the interview. These functions will help to prepare for your JavaScript Interviews in 2021.&lt;/p&gt;
&lt;p id="a6b3" class="graf graf--p graf-after--p"&gt;To reduce the pressure at times let’s get prepared ahead of time!&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2670-HT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AundOkOxQpiMNKFyg"&gt;Photo by &lt;a href="https://unsplash.com/@patrickperkins?utm_source=medium&amp;amp;utm_medium=referral" class="markup--anchor markup--figure-anchor" rel="photo-creator noopener"&gt;Patrick Perkins&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" class="markup--anchor markup--figure-anchor" rel="photo-source noopener"&gt;Unsplash&lt;/a&gt;&lt;h3 id="5f87" class="graf graf--h3 graf-after--figure"&gt;1. Remove Duplicates from an Array&lt;/h3&gt;
&lt;ul class="postList"&gt;&lt;li id="923f" class="graf graf--li graf-after--h3"&gt;
&lt;strong class="markup--strong markup--li-strong"&gt;Arrays&lt;/strong&gt;: these are some handy methods that we can use to remove duplicates from an array.&lt;/li&gt;&lt;/ul&gt;
&lt;ol class="postList"&gt;&lt;li id="38d8" class="graf graf--li graf-after--li"&gt;&lt;strong class="markup--strong markup--li-strong"&gt;Using lodash&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;pre id="b69c" class="graf graf--pre graf-after--li"&gt;let array = [2, 1, 2, 5, 6, 7, 8, 9, 9, 10];&lt;/pre&gt;
&lt;pre id="c83f" class="graf graf--pre graf-after--pre"&gt;let arrayuniq = &lt;em&gt;.uniq(array);//&lt;em class="markup--em markup--pre-em"&gt;[2, 1, 5, 6, 7, 8, 9, 10]&lt;/em&gt;&lt;/em&gt;&lt;/pre&gt;
&lt;p id="d386" class="graf graf--p graf-after--pre"&gt;2. &lt;strong class="markup--strong markup--p-strong"&gt;Using the filter&lt;/strong&gt;&lt;/p&gt;
&lt;pre id="f1b3" class="graf graf--pre graf-after--p"&gt;let array = [2, 1, 2, 5, 6, 7, 8, 9, 9, 10];&lt;/pre&gt;
&lt;pre id="5379" class="graf graf--pre graf-after--pre"&gt;let list = array.filter((x, i, a) =&amp;gt; a.indexOf(x) == i);&lt;/pre&gt;
&lt;pre id="173e" class="graf graf--pre graf-after--pre"&gt;//&lt;em class="markup--em markup--pre-em"&gt;[2, 1, 5, 6, 7, 8, 9, 10]&lt;/em&gt;&lt;/pre&gt;
&lt;p id="9db4" class="graf graf--p graf-after--pre"&gt;3. &lt;strong class="markup--strong markup--p-strong"&gt;Using Set&lt;/strong&gt;&lt;/p&gt;
&lt;pre id="1e49" class="graf graf--pre graf-after--p"&gt;let array = [2, 1, 2, 5, 6, 7, 8, 9, 9, 10];&lt;/pre&gt;
&lt;pre id="c3c3" class="graf graf--pre graf-after--pre"&gt;let setuniq = [...new Set(array)];&lt;/pre&gt;
&lt;pre id="ba37" class="graf graf--pre graf-after--pre"&gt;//&lt;em class="markup--em markup--pre-em"&gt;[2, 1, 5, 6, 7, 8, 9, 10]&lt;/em&gt;&lt;/pre&gt;
&lt;h3 id="53be" class="graf graf--h3 graf-after--pre"&gt;2. Remove Duplicates from Array of Objects&lt;/h3&gt;
&lt;ul class="postList"&gt;&lt;li id="f51f" class="graf graf--li graf-after--h3"&gt;
&lt;strong class="markup--strong markup--li-strong"&gt;Arrays of Objects:&lt;/strong&gt; these are some handy methods that we can use to remove duplicates from an array of objects.&lt;/li&gt;&lt;/ul&gt;
&lt;ol class="postList"&gt;&lt;li id="5005" class="graf graf--li graf-after--li"&gt;&lt;strong class="markup--strong markup--li-strong"&gt;Using lodash&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;pre id="717f" class="graf graf--pre graf-after--li"&gt;let users = [&lt;/pre&gt;
&lt;pre id="e8fa" class="graf graf--pre graf-after--pre"&gt;{ id: 1, name: "ted" },&lt;/pre&gt;
&lt;pre id="eb4a" class="graf graf--pre graf-after--pre"&gt;{ id: 1, name: "bob" },&lt;/pre&gt;
&lt;pre id="f558" class="graf graf--pre graf-after--pre"&gt;{ id: 3, name: "sara" },&lt;/pre&gt;
&lt;pre id="b33c" class="graf graf--pre graf-after--pre"&gt;{ id: 4, name: "test" },&lt;/pre&gt;
&lt;pre id="a8c4" class="graf graf--pre graf-after--pre"&gt;{ id: 4, name: "test" },&lt;/pre&gt;
&lt;pre id="7100" class="graf graf--pre graf-after--pre"&gt;{ id: 5, name: "abc" }&lt;/pre&gt;
&lt;pre id="095b" class="graf graf--pre graf-after--pre"&gt;];&lt;/pre&gt;
&lt;pre id="cfd9" class="graf graf--pre graf-after--pre"&gt;let uniqueUsersByID = _.uniqBy(users, "id");&lt;/pre&gt;
&lt;pre id="f5df" class="graf graf--pre graf-after--pre"&gt;//[{"id":1,"name":"ted"},{"id":3,"name":"sara"},{"id":4,"name":"test"},{"id":5,"name":"abc"}]&lt;/pre&gt;
&lt;p id="c702" class="graf graf--p graf-after--pre"&gt;&lt;em class="markup--em markup--p-em"&gt;We can check unique data with multiple properties with this code.&lt;/em&gt;&lt;/p&gt;
&lt;pre id="9fd2" class="graf graf--pre graf-after--p"&gt;const uniquewithMultipleProperties = _.uniqWith(&lt;br&gt;    users,&lt;br&gt;    (a, b) =&amp;gt; a.id === b.id || a.name === b.name&lt;br&gt;);&lt;br&gt;//[{"id":1,"name":"ted"},{"id":3,"name":"sara"},{"id":4,"name":"test"},{"id":5,"name":"abc"}]&lt;/pre&gt;
&lt;p id="ea04" class="graf graf--p graf-after--pre"&gt;2. &lt;strong class="markup--strong markup--p-strong"&gt;Using a filter&lt;/strong&gt;&lt;/p&gt;
&lt;pre id="5572" class="graf graf--pre graf-after--p"&gt;let filteruniquebyID = users.filter(&lt;br&gt;    (v, i, a) =&amp;gt; a.findIndex(t =&amp;gt; t.id === v.id) === i&lt;br&gt;);&lt;br&gt;//[{"id":1,"name":"ted"},{"id":3,"name":"sara"},{"id":4,"name":"test"},{"id":5,"name":"abc"}]&lt;/pre&gt;
&lt;p id="4b58" class="graf graf--p graf-after--pre"&gt;&lt;em class="markup--em markup--p-em"&gt;We can check unique data with multiple properties with this code.&lt;/em&gt;&lt;/p&gt;
&lt;pre id="9791" class="graf graf--pre graf-after--p"&gt;let filteruniquebyIDName = users.filter(&lt;br&gt;    (v, i, a) =&amp;gt; a.findIndex(t =&amp;gt; t.id === v.id || t.name === v.name) === i&lt;br&gt;);&lt;br&gt;//[{"id":1,"name":"ted"},{"id":3,"name":"sara"},{"id":4,"name":"test"},{"id":5,"name":"abc"}]&lt;/pre&gt;
&lt;p id="50d7" class="graf graf--p graf-after--pre"&gt;3. &lt;strong class="markup--strong markup--p-strong"&gt;Using Set&lt;/strong&gt;&lt;/p&gt;
&lt;pre id="858b" class="graf graf--pre graf-after--p"&gt;var set1 = Array.from(&lt;/pre&gt;
&lt;pre id="64fa" class="graf graf--pre graf-after--pre"&gt;users.reduce((m, t) =&amp;gt; m.set(t.id, t), new Map()).values()&lt;/pre&gt;
&lt;pre id="9486" class="graf graf--pre graf-after--pre"&gt;);&lt;/pre&gt;
&lt;pre id="7a9a" class="graf graf--pre graf-after--pre"&gt;//[{"id":1,"name":"bob"},{"id":3,"name":"sara"},{"id":4,"name":"test"},{"id":5,"name":"abc"}]&lt;/pre&gt;
&lt;p id="e366" class="graf graf--p graf-after--pre"&gt;You can check stackblitz here.&lt;/p&gt;
&lt;p id="633b" class="graf graf--p graf-after--p"&gt;&lt;a href="https://stackblitz.com/edit/remove-duplicates-arrayofobjects" class="markup--anchor markup--p-anchor" rel="nofollow noopener"&gt;&lt;/a&gt;&lt;a href="https://stackblitz.com/edit/remove-duplicates-arrayofobjects"&gt;https://stackblitz.com/edit/remove-duplicates-arrayofobjects&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="c8bc" class="graf graf--h3 graf-after--p"&gt;3. Find an item in Array&lt;/h3&gt;
&lt;ul class="postList"&gt;&lt;li id="800b" class="graf graf--li graf-after--h3"&gt;below are some methods to find an item in the array&lt;/li&gt;&lt;/ul&gt;
&lt;ol class="postList"&gt;&lt;li id="79e0" class="graf graf--li graf-after--li"&gt;
&lt;strong class="markup--strong markup--li-strong"&gt;includes: &lt;/strong&gt;this method determines whether an array includes a certain value among its entries, returning &lt;code class="markup--code markup--li-code"&gt;true&lt;/code&gt; or &lt;code class="markup--code markup--li-code"&gt;false&lt;/code&gt; as appropriate.&lt;/li&gt;&lt;/ol&gt;
&lt;pre id="3c52" class="graf graf--pre graf-after--li"&gt;console.log(array.includes(2)); // returns true&lt;/pre&gt;
&lt;p id="4fe6" class="graf graf--p graf-after--pre"&gt;2. &lt;strong class="markup--strong markup--p-strong"&gt;every: &lt;/strong&gt;this method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value.&lt;/p&gt;
&lt;pre id="b7ad" class="graf graf--pre graf-after--p"&gt;let testevery1 = array.every(val=&amp;gt; val&amp;gt;3); //false&lt;/pre&gt;
&lt;p id="8c3f" class="graf graf--p graf-after--pre"&gt;3. &lt;strong class="markup--strong markup--p-strong"&gt;some: &lt;/strong&gt;this method tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value.&lt;/p&gt;
&lt;pre id="ed61" class="graf graf--pre graf-after--p"&gt;let testsome1 = array.some(val=&amp;gt; val&amp;gt;3); //true&lt;/pre&gt;
&lt;p id="5a0f" class="graf graf--p graf-after--pre"&gt;4.&lt;strong class="markup--strong markup--p-strong"&gt; lodash includes:&lt;/strong&gt; checks if &lt;code class="markup--code markup--p-code"&gt;value&lt;/code&gt; is in &lt;code class="markup--code markup--p-code"&gt;collection&lt;/code&gt; .Returns &lt;code class="markup--code markup--p-code"&gt;true&lt;/code&gt; if &lt;code class="markup--code markup--p-code"&gt;value&lt;/code&gt; is found, else &lt;code class="markup--code markup--p-code"&gt;false&lt;/code&gt;.&lt;/p&gt;
&lt;pre id="8721" class="graf graf--pre graf-after--p"&gt;let lodashtest9 =.includes(array, 1); // true&lt;/pre&gt;
&lt;pre id="58f3" class="graf graf--pre graf-after--pre"&gt;let lodashtest10 =&lt;em&gt;.includes(array, 3, 2); // false&lt;/em&gt;&lt;/pre&gt;
&lt;p id="4116" class="graf graf--p graf-after--pre"&gt;5. &lt;strong class="markup--strong markup--p-strong"&gt;findIndex: &lt;/strong&gt;this&lt;strong class="markup--strong markup--p-strong"&gt; &lt;/strong&gt;method returns the &lt;strong class="markup--strong markup--p-strong"&gt;index&lt;/strong&gt; of the first element in the array &lt;strong class="markup--strong markup--p-strong"&gt;that satisfies the provided testing function&lt;/strong&gt;. Otherwise, it returns &lt;code class="markup--code markup--p-code"&gt;-1&lt;/code&gt;, indicating that no element passed the test.&lt;/p&gt;
&lt;pre id="3bbc" class="graf graf--pre graf-after--p"&gt;let  testindex = array.findIndex(val =&amp;gt; val &amp;gt; 1);&lt;br&gt;//0&lt;/pre&gt;
&lt;p id="7869" class="graf graf--p graf-after--pre"&gt;6.&lt;strong class="markup--strong markup--p-strong"&gt; find: &lt;/strong&gt;this method returns the value of the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, &lt;code class="markup--code markup--p-code"&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener"&gt;undefined&lt;/a&gt;&lt;/code&gt; are returned.&lt;/p&gt;
&lt;pre id="dd26" class="graf graf--pre graf-after--p"&gt;let testfind = array.find(el =&amp;gt; (el &amp;gt; 2));&lt;br&gt;//5&lt;/pre&gt;
&lt;p id="c4f6" class="graf graf--p graf-after--pre"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;7. filter: &lt;/strong&gt;this&lt;strong class="markup--strong markup--p-strong"&gt; &lt;/strong&gt;method &lt;strong class="markup--strong markup--p-strong"&gt;creates a new array&lt;/strong&gt; with all elements that pass the test implemented by the provided function.&lt;/p&gt;
&lt;pre id="3a7d" class="graf graf--pre graf-after--p"&gt;let testfilter1 = array.filter(val=&amp;gt; val&amp;gt;3);&lt;br&gt;//&lt;em class="markup--em markup--pre-em"&gt;[5, 6, 7, 8, 9, 9, 10]&lt;/em&gt;&lt;/pre&gt;
&lt;p id="9ba7" class="graf graf--p graf-after--pre"&gt;8. &lt;strong class="markup--strong markup--p-strong"&gt;map: &lt;/strong&gt;this method &lt;strong class="markup--strong markup--p-strong"&gt;creates a new array&lt;/strong&gt; populated with the results of calling a provided function on every element in the calling array.&lt;/p&gt;
&lt;pre id="3fab" class="graf graf--pre graf-after--p"&gt;let val = [];&lt;br&gt;array.map(item =&amp;gt; { if(item &amp;gt;= 3) val.push(item); });&lt;br&gt;//&lt;em class="markup--em markup--pre-em"&gt;[5, 6, 7, 8, 9, 9, 10]&lt;/em&gt;&lt;/pre&gt;
&lt;p id="3dcd" class="graf graf--p graf-after--pre"&gt;You can check stackblitz here.&lt;/p&gt;
&lt;p id="b7c7" class="graf graf--p graf-after--p"&gt;&lt;a href="https://stackblitz.com/edit/find-item-array" class="markup--anchor markup--p-anchor" rel="nofollow noopener"&gt;&lt;/a&gt;&lt;a href="https://stackblitz.com/edit/find-item-array"&gt;https://stackblitz.com/edit/find-item-array&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="355a" class="graf graf--h3 graf-after--p"&gt;4. Find an item in the Array of Objects&lt;/h3&gt;
&lt;ul class="postList"&gt;&lt;li id="76fc" class="graf graf--li graf-after--h3"&gt;these are the methods that can be used to find an item in the array of objects.&lt;/li&gt;&lt;/ul&gt;
&lt;p id="e633" class="graf graf--p graf-after--li"&gt;1. &lt;strong class="markup--strong markup--p-strong"&gt;every: &lt;/strong&gt;this method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value.&lt;/p&gt;
&lt;pre id="1507" class="graf graf--pre graf-after--p"&gt;let testevery2 = users.every(val=&amp;gt; val.id&amp;gt;3);&lt;br&gt;//false&lt;/pre&gt;
&lt;p id="3411" class="graf graf--p graf-after--pre"&gt;2. &lt;strong class="markup--strong markup--p-strong"&gt;some: &lt;/strong&gt;this method tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value.&lt;/p&gt;
&lt;pre id="d417" class="graf graf--pre graf-after--p"&gt;let testsome2 = users.some(val=&amp;gt; val.id&amp;gt;3); //true&lt;/pre&gt;
&lt;p id="1612" class="graf graf--p graf-after--pre"&gt;3.&lt;strong class="markup--strong markup--p-strong"&gt; lodash includes:&lt;/strong&gt; checks if &lt;code class="markup--code markup--p-code"&gt;value&lt;/code&gt; is in &lt;code class="markup--code markup--p-code"&gt;collection&lt;/code&gt; .Returns &lt;code class="markup--code markup--p-code"&gt;true&lt;/code&gt; if &lt;code class="markup--code markup--p-code"&gt;value&lt;/code&gt; is found, else &lt;code class="markup--code markup--p-code"&gt;false&lt;/code&gt;.&lt;/p&gt;
&lt;pre id="63e4" class="graf graf--pre graf-after--p"&gt;let lodashtest11 =.includes({ 'a': 1, 'b': 2 }, 1);&lt;br&gt;//true&lt;br&gt;let lodashtest12 =_.includes('abcd', 'bc');&lt;br&gt;//true&lt;/pre&gt;
&lt;p id="3f1d" class="graf graf--p graf-after--pre"&gt;4. &lt;strong class="markup--strong markup--p-strong"&gt;findIndex: &lt;/strong&gt;this&lt;strong class="markup--strong markup--p-strong"&gt; &lt;/strong&gt;method returns the &lt;strong class="markup--strong markup--p-strong"&gt;index&lt;/strong&gt; of the first element in the array &lt;strong class="markup--strong markup--p-strong"&gt;that satisfies the provided testing function&lt;/strong&gt;. Otherwise, it returns &lt;code class="markup--code markup--p-code"&gt;-1&lt;/code&gt;, indicating that no element passed the test.&lt;/p&gt;
&lt;pre id="be6b" class="graf graf--pre graf-after--p"&gt;let  testindex2 = users.findIndex(val =&amp;gt; val.id &amp;gt; 1);&lt;br&gt;//3&lt;/pre&gt;
&lt;p id="6157" class="graf graf--p graf-after--pre"&gt;5.&lt;strong class="markup--strong markup--p-strong"&gt; find: &lt;/strong&gt;this method returns the value of the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, &lt;code class="markup--code markup--p-code"&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener noopener"&gt;undefined&lt;/a&gt;&lt;/code&gt; are returned.&lt;/p&gt;
&lt;pre id="2717" class="graf graf--pre graf-after--p"&gt;let testfind2 = users.find(el =&amp;gt; (el.id &amp;gt; 2));&lt;br&gt;//{"id":3,"name":"sara"}&lt;/pre&gt;
&lt;p id="efa9" class="graf graf--p graf-after--pre"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;6. filter: &lt;/strong&gt;this&lt;strong class="markup--strong markup--p-strong"&gt; &lt;/strong&gt;method &lt;strong class="markup--strong markup--p-strong"&gt;creates a new array&lt;/strong&gt; with all elements that pass the test implemented by the provided function.&lt;/p&gt;
&lt;pre id="dedf" class="graf graf--pre graf-after--p"&gt;let testfilter2 = users.filter(val=&amp;gt; val.id&amp;gt;3);&lt;/pre&gt;
&lt;p id="4dd9" class="graf graf--p graf-after--pre"&gt;7. &lt;strong class="markup--strong markup--p-strong"&gt;map: &lt;/strong&gt;this method &lt;strong class="markup--strong markup--p-strong"&gt;creates a new array&lt;/strong&gt; populated with the results of calling a provided function on every element in the calling array.&lt;/p&gt;
&lt;pre id="8a66" class="graf graf--pre graf-after--p"&gt;let val2 = [];&lt;/pre&gt;
&lt;pre id="bf7c" class="graf graf--pre graf-after--pre"&gt;users.map(item =&amp;gt; { if(item.id &amp;gt;= 3) val2.push(item); });&lt;/pre&gt;
&lt;p id="3a5d" class="graf graf--p graf-after--pre"&gt;You can check stackblitz here.&lt;/p&gt;
&lt;p id="b0be" class="graf graf--p graf-after--p"&gt;&lt;a href="https://stackblitz.com/edit/find-item-array" class="markup--anchor markup--p-anchor" rel="nofollow noopener noopener"&gt;&lt;/a&gt;&lt;a href="https://stackblitz.com/edit/find-item-array"&gt;https://stackblitz.com/edit/find-item-array&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="4a40" class="graf graf--h3 graf-after--p"&gt;5. Sort Array items&lt;/h3&gt;
&lt;p id="488b" class="graf graf--p graf-after--h3"&gt;Arrays can be sort using the sort method.&lt;/p&gt;
&lt;p id="4cbf" class="graf graf--p graf-after--p"&gt;The &lt;code class="markup--code markup--p-code"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;sort()&lt;/strong&gt;&lt;/code&gt; method sorts the elements of an array &lt;a href="https://en.wikipedia.org/wiki/In-place_algorithm" class="markup--anchor markup--p-anchor" rel="noopener"&gt;&lt;em class="markup--em markup--p-em"&gt;in place&lt;/em&gt;&lt;/a&gt; and returns the sorted array. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code unit values.&lt;/p&gt;
&lt;pre id="7a8b" class="graf graf--pre graf-after--p"&gt;const months = ['March', 'Jan', 'Feb', 'Dec'];&lt;br&gt;months.sort();&lt;br&gt;console.log(months);&lt;br&gt;// expected output: Array ["Dec", "Feb", "Jan", "March"]&lt;/pre&gt;
&lt;pre id="a98c" class="graf graf--pre graf-after--pre"&gt;const array1 = [1, 30, 4, 21, 100000];&lt;br&gt;array1.sort();&lt;br&gt;console.log(array1);&lt;br&gt;// expected output: Array [1, 100000, 21, 30, 4]&lt;/pre&gt;
&lt;br&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://medium.com/javascript-in-plain-english/22-utility-functions-to-ace-your-javascript-coding-interview-21ca676ad70"&gt;Continue reading on Medium »&lt;/a&gt;
&lt;/h2&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
