Default Function Parameters in JavaScript

preview_player
Показать описание


In JavaScript, if the caller does not provide the arguments to the function, the function parameters default to undefined.
However, it's often useful to set a different default value. This is where default parameters can help.

In this video, you will learn how to use default parameters. You will validate that when not providing any arguments, the function parameters are undefined.
You will also see an alternative of performing checks for undefined values, and then finding out how default parameters help you write safe and less code to achieve more.

**********Watch all JavaScript Tutorials**********

***************************************************

Рекомендации по теме