code-tidbits
code-tidbits copied to clipboard
Royal Wedding with Default Parameter
Multiple Default Parameters
function marryMe(yes = 'I will', prince = 'Harry') {
console.log(yes);
console.log(prince);
}
marryMe();
// yes
// Harry
to
function marryMe(yes = 'I will', prince = 'Harry') {
console.log(yes);
console.log(prince);
}
marryMe();
// I will
// Harry