For this lecture, I made a quick-start with JS (HTML was involved as well). Basically what I did was create a new folder in the editor and used an HTML file as follows:
What we explored was the two ways of embedding JS into an HTML file. You can do it with inline script or by linking to a JS file. Today I experimented using JS to print ‘Hello World!’ to the console with both methods.
The JS file I created is very simple:
It threw an error saying the console was undefined, even though I seemed to follow the instructions. And it worked as intended. Perhaps the reasons for that will become clear.
It was satisfying to see something I made open up in a web browser. Find it below. The text is simply the notes I took during the lecture, writing it at the bottom of the HTML document.