Friday 29 April 2016

Undefined - The Complete Node JS Developer Course

Undefined


Lesson 16 of The Complete Node JS Developer course @Udemy is all about undefined. This independent task follows on from the previous lessons, and includes functions and if statements. Typeof also makes a reappearance.

This time we had to create a function that returns one thing if we give it an argument, or something else if we don't give it anything. See the code below. It is also on Github.


In the first instance, on line 16, we have given the function a name, Andrew, so it will return 'hello Andrew'. In the second case, on line 17, we have left the brackets empty, so it will return 'hello world'.

No comments:

Post a Comment