@babel/plugin-proposal-numeric-separator
Binary Literals
let nibbles = 0b1010_0001_1000_0101;
// Is bit 7 on? It sure is!
// 0b1010_0001_1000_0101
// ^
console.log(!!(nibbles & (1 << 7))); // true
Octal Literal
npm install --save-dev @babel/plugin-proposal-numeric-separator
Via CLI
babel --plugins @babel/plugin-proposal-numeric-separator script.js
With a configuration file (Recommended)
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-proposal-numeric-separator"]
}
{