I want to pass optionally an array to a function or an array setting it to a default value.
This is the typical way:
function myfunc(...values : Array<number>)
I know that I can do it this way, but I don't know how to set it to allow this function calls:
myfunc()
myfunc(1)
myfunc(1,2)
myfunc([1, 2])
with the above, all except myfunc() are supported. How can I make it?