Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 8
---
id: babel-plugin-transform-exponentiation-operator
title: @babel/plugin-transform-exponentiation-operator
sidebar_label: exponentiation-operator
---
NOTE: This plugin is included in
@babel/preset-env
, in ES2016
In
let x = 10 ** 2;
x **= 3;
Out
let x = Math.pow(10, 2);
x = Math.pow(x, 3);
npm install --save-dev @babel/plugin-transform-exponentiation-operator
{
"plugins": ["@babel/plugin-transform-exponentiation-operator"]
}
babel --plugins @babel/plugin-transform-exponentiation-operator script.js
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-transform-exponentiation-operator"],
});