Created
January 2, 2019 11:06
-
-
Save DeeSouza/3b02008373422b1f8750552636608bd6 to your computer and use it in GitHub Desktop.
Dois Caminhos para Cálculo Exponencial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usando a Função Math 👍 | |
console.log(Math.pow(5, 2)); // 25 | |
// Usando o Exponentiation Operator - ES7 | ES2016 ( '**' ) 👍👍👍 | |
// Nesse caso você evita o uso de função. | |
console.log(5 ** 2); // 25 (Base, Expoente) | |
// Você pode fazer assim também, usando a notação '**=' | |
let num 5; // Base | |
num **= 2; // Expoente | |
console.log(num); // 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Excelent!