ganqqwerty / 123-Essential-JavaScript-Interview-Questions

JavaScript interview Questions
BSD 3-Clause "New" or "Revised" License
5.01k stars 1.18k forks source link

Question 47 . How to set a default parameter value ? #77

Open harmansingha opened 5 years ago

harmansingha commented 5 years ago

There is one more way to set default parameter value:

function sendEmail(configuration, provider = "Gmail") {
console.log(`Provider: ${provider}`);
}

sendEmail("Config");
ganqqwerty commented 5 years ago

Indeed it’s possible in es6

ganqqwerty commented 4 years ago

can you create a pull request?