code-tidbits icon indicating copy to clipboard operation
code-tidbits copied to clipboard

Royal Wedding with Default Parameter

Open rajguru827 opened this issue 6 years ago • 0 comments

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

rajguru827 avatar Oct 06 '19 02:10 rajguru827