Numeric Separators (_)
Numeric Separators (_) in JavaScript (ES2021/ES2022) allow improved readability by placing underscores as visual separators in large numbers for better code comprehension.
Syntax:
let num1 = 1_000_000_000;
Example: Here is the basic example of above method.
Javascript
let num1 = 1_000_000_000; let num2 = 1000000000; console.log(num1 === num2); |
Output
true
ECMAScript 2021 (JS 2021/2022)
JavaScript in 2021/2022 continues to evolve, with ES2021/ES2022 bringing enhanced features like private class fields, promise improvements, and record data structures, boosting developer productivity and code quality.