Original Tweet From @ajaysharma_dev
It is one of the features of ES6.
When a JavaScript function is called with fewer than the declared number of arguments, the missing values are set to 'undefined.’
Sometimes this is acceptable, but other times it is preferable to provide the argument a default value.
Let's learn the default Parameter with examples.
think what will happen if we will not provide the value
Here, now we can set the default parameter
It also allows default parameter values in the function declaration
If you enjoyed reading this thread, please do the following:
- Like the thread❤️
- Retweet the first tweet.🔃
- Follow me and enable notifications: ✅ @ajaysharma_dev Thank you for reading all the way through.
Top comments (0)