@babel/plugin-transform-exponentiation-operator

Example

In

  1. let x = 10 ** 2;
  2. x **= 3;

Out

  1. let x = Math.pow(10, 2);
  2. x = Math.pow(x, 3);

Installation

  1. npm install --save-dev @babel/plugin-transform-exponentiation-operator

Usage

.babelrc

  1. {
  2. "plugins": ["@babel/plugin-transform-exponentiation-operator"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-exponentiation-operator script.js

Via Node API

  1. require("@babel/core").transform("code", {
  2. plugins: ["@babel/plugin-transform-exponentiation-operator"]
  3. });

References