Last active
March 5, 2021 22:14
-
-
Save NyaGarcia/76e7ca13a60b632c07dea5acf2afcd7d to your computer and use it in GitHub Desktop.
Setting default parameters in an arrow function
This file contains hidden or 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
const choosePokemon = ( | |
firstPokemon = "Charmander", | |
secondPokemon = "Bulbasaur" | |
) => `I choose ${firstPokemon} and ${secondPokemon}`; | |
// Calling function without parameters | |
console.log(choosePokemon()); | |
// Output: I choose Charmander and Bulbasaur |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment