---
title: "Discussion on \"Upcoming Interesting JavaScript ES2021 (ES12) Features to Look for\" | Hashnode"
description: "Discussion on \"Upcoming Interesting JavaScript ES2021 (ES12) Features to Look for\". The ES2021 (ES12) will be released in the middle of 2021. In this tutorial, you will learn about the five most interesting features from this specification: String.prototype.replaceAll(), numeric separators, logical assignment operators, Promise.any(..."
url: "https://hashnode.com/posts/upcoming-interesting-javascript-es2021-es12-features-to-look-for-1/6055db305f8d512169726a2d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Upcoming Interesting JavaScript ES2021 (ES12) Features to Look for](https://alimammiya.hashnode.dev/upcoming-interesting-javascript-es2021-es12-features-to-look-for-1?utm_source=hashnode&utm_medium=feed)

The ES2021 (ES12) will be released in the middle of 2021. In this tutorial, you will learn about the five most interesting features from this specification: String.prototype.replaceAll(), numeric separators, logical assignment operators, Promise.any(...

Mar 20, 2021 · 17 min read · alimammiya.hashnode.dev  
Updated Mar 21, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Alimam Miya](https://hashnode.com/@alimammiya)

@alimammiya · Gurugram, India

  
[View profile](https://hashnode.com/@alimammiya)

I'm not a great programmer, I'm a good programmer, with great habits.

👨‍💻 Engineer by Education, 👨‍💼 Entrepreneur by profession, ⚙️ Developer by interest, 🔗 SEO tips sharing by passion

## Responses 1

Markdown supported · ⌘↵ to post

[Nhut nguyen minh](https://hashnode.com/@devNhut)

[Mar 23, 2021](https://hashnode.com/posts/upcoming-interesting-javascript-es2021-es12-features-to-look-for-1/6055db305f8d512169726a2d/comment/605a266c47b0d2243d4aaef2)

I have a question : why Semicolon before arrow IIFE ??? ;(() => {})() .

[Adarsh Hegde](https://hashnode.com/@adarshhegde)

[Mar 24, 2021](https://hashnode.com/posts/upcoming-interesting-javascript-es2021-es12-features-to-look-for-1/6055db305f8d512169726a2d/comment/605a266c47b0d2243d4aaef2#reply-605b9c3b78c4742436d5007c)

its to prevent the IIFE opening and closing parenthesis to act as a function call for the previous statement which will throw an error let statement\_1 = () => console.log("whatever");

statement\_1()

(() => { console.log("haha") })()

this will throw an error, statement\_1(...) is not a function

but you might say it is a function, so why the error?

statement\_1() // this statement executes that anonymous function, and returns nothing,

and the opening and closing ( parenthesis ) of the IIFE will make it look like its a function call for the return value of the above statement so it will actually look like

statement\_1()( ()=>{ .. } )() // the outer IIFE parenthesis is now acting as function call syntax for return value of statement\_1()

so it'll try to call the returned value from statement\_1() as a function, so it will cause all loads of bugs and errors, to fix this we manually state the end of the first statement with a semicolon, this way the JavaScript engine doesn't get confused and can differentiate between the two statements properly

statement\_1();

( () => {}) ()

TL;DR use semicolons more often.

in the post they just placed the semicolon at the beginning of the IIFE rather than end of first statement.
