Essentially it is interpreted language in that doesn't need to be translated or compiled its reader simply executes each line as it comes to it (much like a moviescript).
Lets look at our clock
Note the // indicate the start and end of the script. The script itself is dead easy. The document.write tells the browser to write the info contained in the brackets with the document.lastModified showing the HTML file's last modified time.
Here's another working example in the next line of text
In HTML this is coded as this-
You can write some very complex and powerful Scripts
Please not this is a fun example and not a serious form for calculating car loans