When we write code and do not put it inside a function, it is attached to the global object.

Lets try this by writing some code in the file app.js.

Copy and paste the folling code into app.js:

What this does:

console.log() will print the message in the console to show us that the function was called, thats all. 😁

Back to Topics πŸ‘ˆπŸ»

Next Lesson: Comming upClick hereπŸ‘‰πŸ½

Take one minute to let us know what you want us to cover here Here .

Connect on twitter Twitter.