$ npm install @putout/plugin-convert-math-pow
- The
Math.pow()static method, given two arguments, base and exponent, returns baseexponent.- The exponentiation operator (
**) returns the result of raising the first operand to the power of the second operand. It is equivalent toMath.pow, except it also accepts BigInts as operands.(c) MDN
🐊Putout plugin adds ability to convert Math.pow to exponentiation operator. Merged to @putout/plugin-math.
npm i @putout/plugin-convert-math-pow -D
{
"rules": {
"convert-math-pow": "on"
}
}
Math.pow(2, 4);
2 ** 4;
| Linter | Rule | Fix |
|---|---|---|
| 🐊 Putout | convert-math-pow |
✅ |
| ⏣ ESLint | prefer-exponentiation-operator |
✅ |
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE