How can I declare optional function parameters in JavaScript? [duplicate]

Can I declare default parameter like

function myFunc( a, b=0)
{
  // b is my optional parameter
}

in JavaScript?

2 Answers
2

Leave a Comment