Assigning function parameter values to a variable?


Sorry if this answer is really obvious (perhaps brain not working), but say I have a function which takes four numbers e.g. function (a,b,c,d) and I want t create an array from those parameters (as yet unknown, until function is called), can I just assign them to an (array) variable - e.g. tempVal = [a,b,c,d].

Not sure why this is causing me so much confusion, but it is.

Grateful for any input.

You can, but you might want to use a rest parameter instead.

1 Like

great, thanks for the info