I have a function which has two default parameters and one regular parameter.
var Fields = function ($content, result = failedObject, job = true)
{
...
}
When I call Fields($content,job)
, job here could be true or false, the result parameter takes in the job value rather than the third parameter. Works good in the case if Fields($content,result)
.
Any good way to tackle this situation.