ES7 introduced the exponentiation operator **
so that using Math.pow
is no longer necessary.
Apply with the Grit CLI
grit apply use_exponentiation_operator
Transforms Math.pow to exponentiation operator
BEFORE
var a = Math.pow(0, 1); var b = Math.pow(0, b - 1); var c = Math.pow(b + 1, b - 1); var d = Math.pow(b + 1, 1);
AFTER
var a = (0) ** (1); var b = (0) ** (b - 1); var c = (b + 1) ** (b - 1); var d = (b + 1) ** (1);