You can create a new folder for this project or continue on with the last one from the previus exercise.
The structure of our html file remains the same.
copy the code and paste into app.js
Run the code by opening the index.html
On running the code, b is called, then a is logged and a is logged again.
What do you see?
The first time a is called it returns
undefined and the second time we get
This is because the code is in execution phase. During the creation phase the var a was assigned the value
And now in the execution phase a is returned as
The next line now asigns the the value
Hello World to a and when a is again called we now see
Invocation means calling a function or running a function.
What are functions?.. Tune in to the next post
Back to Topics 👈🏻
Take one minute to let us know what you want us to cover here Here .