math - Is the double asterisk ** a valid Javascript operator? -


i solved kata on codewars , looking through of other solutions when came across double asterisk signify power of. have done research , can see valid operator in python can see nothing in javascript documentation.

var findnb = m => {   var n = math.floor((4*m)**.25);   var sum = x => (x*(x+1)/2)**2;   return sum(n) == m ? n : -1; } 

yet when run solution on codewars, seems work. wondering if new in es6, although have found nothing it.

yes. ** exponentiation operator , equivalent of math.pow.

it introduced in ecmascript 2016 (es7).

for details, see proposal , chapter of exploring es2016.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -