Default Parameters in JavaScript | ECMAScript 2015 New Feature

preview_player
Показать описание
Featured in ECMAScript 2015 are default function parameters, with these you are able to set default values for your function parameters if no value or 'undefined' is passed in.

This is clearly useful for when you have parameters that are optional and you'd like default behavior when the purpose of your functional call need not provide that specific information.

In this video I take you through an example of the basic usage as well as how you are able to 'skip' default parameters with the 'undefined' keyword.

For your reference, check this out:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Dude, thank you su much! Now I've got it better then from MDN

mismischchmischung