A part of bed with some pillows and next to a small closet with an alarm clock on top.

ES6: default parameters

We could pass some parameters in functions, right? Okay. With ES6 it is possible assign default values for them if they are not passed.

When we create a function, we could verify that the values were passed or not, and maybe assign a value to it; something like that.

Now, we could do something like that:

Here you can find an JS Bin with the examples.

See all posts...