Skip to content

Instantly share code, notes, and snippets.

@DiegoPinho
Created September 22, 2017 15:27
Show Gist options
  • Save DiegoPinho/4ea5778b76649baebdfba6a46d199f9e to your computer and use it in GitHub Desktop.
Save DiegoPinho/4ea5778b76649baebdfba6a46d199f9e to your computer and use it in GitHub Desktop.
function multiplicaPor(valor, multiplcador = valor) {
// caso o multiplicador não seja passado, ele será o próprio valor
return multiplcador * valor;
}
multiplicaPor(2,3); // 6
multiplicaPor(2); // 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment