DEV Community

Discussion on: 10 Practical JavaScript Tricks

Collapse
 
avraammavridis profile image
Avraam Mavridis
  1. 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

  2. Here your function will fail if the passed value is 0.

function doSomething(arg1){ 
    arg1 = arg1 || 32; // if it's not already set, arg1 will have 32 as a default value
}