Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Exponent Power Shorthand in javascript

// Exponent Power Shorthand in javascript
// Longhand:
console.log(Math.pow(2,3)); // 8
console.log(Math.pow(2,2)); // 4
console.log(Math.pow(4,3)); // 64

// Shorthand:
console.log(2**3); // 8
console.log(2**4); // 4
console.log(4**3); // 64
 
PREVIOUS NEXT
Tagged: #Exponent #Power #Shorthand #javascript
ADD COMMENT
Topic
Name
2+1 =