Skip to content

Instantly share code, notes, and snippets.

@talitaoliveira
Created November 27, 2018 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talitaoliveira/ce6a7fc9b8f50a4a9da8492b43210a0c to your computer and use it in GitHub Desktop.
Save talitaoliveira/ce6a7fc9b8f50a4a9da8492b43210a0c to your computer and use it in GitHub Desktop.
Using the new feature of ES7: Exponentiation Operator
/**
* EXPONENTIATION OPERATOR
* - Is the same as Math.pow()
* - Don't need to use the library Math
*/
// using Math library
let newNumber1 = Math.pow(4, 2);
console.log(newNumber1); // 16
// not using Math library
let newNumber2 = 4 ** 2;
console.log(newNumber2); // 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment