When writing functions, we might have times when we have argument sent and other times when no arguments are sent to the function. In the cases where no arguments are sent, we might want to have default parameter values.
let getName = (animalName = ‘Bongo’) => {
return animalName;
}
console.log(getName());
In this case, “Bongo” prints out because we did not send any arguments. If we change our log statement…
console.log(getName(‘George’));
The output will now be “George”.