ES6: default parameters

We could pass some parameters in functions. Okay. With ES6, it is possible to 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.

Now, we could do something like that:

Here you can find a JS Bin with the examples.

See all posts...