RE: The Exponentiation Operator in JavaScript

You are viewing a single comment's thread from:

The Exponentiation Operator in JavaScript

in technology •  7 years ago 

This syntax is much easier to use than Math.pow. I wonder if there is a performance boost, as well.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Good question. Probably there is a better performance, because the method call is removed.

So, I ran a benchmark and turns out ** is almost three times faster than Math.pow on NodeJS.

That's a very nice performance boost. It surely is an improvement.