Hello 

This is the day 25 of #30 days of javascrip coding, at this day I studied Function Default Parameters Lesson i learned that
1- The Default Value, if there is no value for the Parameter, it  will be Undefined
2-If you do not write a value for the age parameter, the result will be Undefined by default
3-However, if the user actually did not enter the Age, it would not make sense for it to be Undefined, and it would be better if an alternative message was printed in its place. This can be done in 3 ways, including the ES6 method.
4-The first way is to make a condition if the default age value is Undefined. This definitely indicates that the user neglected to enter the age value, because Undefined does not appear unless the user neglected to write the age.
5-Here, if the value of age becomes Undefined, meaning the user left it empty, print the place of the variable age. This is an alternative word called Unknown, so I stored it as a variable in the age so that it is replaced with Undefined.
6- I will learn other methods in the following lessons
That's what I learned today and this is the codes i have typed

Comments

Popular posts from this blog