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).
Comments
Post a Comment