I would just use Array.from(arguments) but still can't see a real scenario that you would need to use array functions in the arguments list
Array.from(arguments)
Here your function will fail if the passed value is 0.
0
function doSomething(arg1){ arg1 = arg1 || 32; // if it's not already set, arg1 will have 32 as a default value }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would just use
Array.from(arguments)
but still can't see a real scenario that you would need to use array functions in the arguments listHere your function will fail if the passed value is
0
.