Using this function def: myFunc(p1, p2, p3 = 3, p4 = 4){ //do something }
I understand that you can call a function using Apply
,
Like this: myFunc.apply([1, 2])
Where 1 is p1 and 2 is p2.
But how would one use apply
when specifying a specific optional param name?:
myFunc(1, 2, p4=>5)
Thanks!