In 2021 we will see a new version of JavaScript.

🔥 ES 12 🔥

Almost all the features are useful.

But three of them stood out from the pack.

Here they are👇👇👇
1. Logical Assignment Operator

The logical assignment operator combines logical operations (like ??, &&, or ||) with an assignment (e.g. =)

Some examples 👇
a ||= b returns a if a is truthy or b if a is falsy.
a &&= b returns b if a is truthy or a if a is falsy.
a ??= b returns b if a is null or undefined, or it returns a if a is truthy.
2. Promise.any

Promise.any accepts an array of promises and resolves as soon as any of the supplied promises become resolved.

Sounds difficult, so here is an example 👇
If all promises were rejected, Promise.any throws a new type of error: AggregateError.

What’s new about it is the AggregateError object represents an error where several errors are wrapped in a single error.

Here's how it works 👇
3. Numeric Separators

Numeric separators give us the ability to separate thousands with an underscore (`_`) in numeric literals.

How is it useful?

It makes our code more informative and readable.

Example 👇
Thanks for reading!

If you want to try these three new features of ES2021 right now, you can use Babel plug-ins.

And if you want to know more about the latest JavaScript insights join my 3-2-1 newsletter 👇

nickbulljs.com/newsletter/

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nick Bull

Nick Bull Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @nickbulljs

21 Oct
5 Techniques I Use To Manage Stress As A Software Engineer

Lessons learned from 48+ books on self-development

🧵Long Thread 🧵

#100DaysOfCode
1. Morning Journal

This is a technique I’ve been using for 3+ years and it’s a freaking golden.

Every morning I write two things:

1. Brain dump (all thoughts, feelings, and experiences I want to write down)
2. The goal for today (one main goal that I have to achieve today)
If you reflect and write everything you have on your mind (what you are stressing about) you will less procrastinate throughout the day and less thinking about *that one problem* you have.
Read 21 tweets
20 Oct
Are you preparing for your interview?

Here is a list of resources I use to prepare for a Web Developer / Frontend position:

🧵 Thread 🧵

#100DaysOfCode
1. Technical Interview

This repository has practical content that covers all phases of a technical interview, from applying for a job to passing the interviews to offer negotiation.

github.com/yangshun/tech-…
2. HTML

40 important HTML interview questions with answers

codeproject.com/Articles/70205…
Read 15 tweets
19 Oct
Complete Guide How To Code Review

Best practices from Google, Apple, Facebook, and Amazon

🧵 Thread 🧵

#100DaysOfCode
Let's start with the question:

What’s the end goal of the code review?

The primary purpose of the code review is to make sure that the solution is solving the problem in the best possible way. From the code and product perspective.
But how do you determine if the solution you are reviewing is the best way to solve the problem? In other words, how to code review?

Let’s deep dive into it.
Read 23 tweets
18 Oct
10 Interview Questions Every JavaScript Developer Should Know

🧵 Thread...
1. Name two programming paradigms important for JavaScript?

JavaScript is a multi-paradigm language, supporting imperative/procedural programming along with OOP (Object-Oriented Programming) and functional programming
2. What is functional programming?

Functional programming produces programs by composing mathematical functions and avoids shared state & mutable data
Read 12 tweets
17 Oct
6 Ways To Improve Web Performance With Preload Content

prefetch vs preload vs preconnect vs dns-prefetch vs prerender vs modulepreload

*advanced javascript techniques*

🧵 Thread... Image
1. preload

<link rel="preload"> tells the browser to download and cache a resource (script or stylesheet) as soon as possible

It’s helpful when you need that resource a few seconds after loading the page
2. prefetch

<link rel="prefetch"> tells browser to download and cache a resource in the background

The download happens with a low priority, so it doesn’t interfere with more important resources

It’s helpful when you need resource on a subsequent page
Read 11 tweets
15 Oct
General skills you should know before starting in web development

∙ GIT
∙ HTTP(S) protocol
∙ How to Google
∙ Terminal (bash, zsh, fish)
∙ Algorithms and Data Structures
∙ Design Patterns
You need these skills to start your web development career.

You don't need these skills to start learning web development.

It's two different things.

Don't confuse them.
This tweet blew up and some developers have another opinion on this.

2 popular one:

”I started my career without knowing these skills”

”you only need to know how to google”

In most cases I agree, but these are just beautiful words.

Here's what's wrong with them 👇
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!