DEV Community

Discussion on: 10 Practical JavaScript Tricks

Collapse
 
bobj2018 profile image
Joshua Rieth

To provide a default parameter value:

function doSomething(args1 = 31) {

}

If an argument is passed, it is used rather than the default.