Skip to content

Instantly share code, notes, and snippets.

@DeeSouza
Created January 2, 2019 11:06
Show Gist options
  • Save DeeSouza/3b02008373422b1f8750552636608bd6 to your computer and use it in GitHub Desktop.
Save DeeSouza/3b02008373422b1f8750552636608bd6 to your computer and use it in GitHub Desktop.
Dois Caminhos para Cálculo Exponencial
// 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
@GeraldoLopesFernandes
Copy link

Excelent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment