Module Four Overview

Lessons Learned in Module Four

Our final module, module four, focused on JavaScript, a language that alongside HTML and CSS is one of the three core technologies of the World Wide Web content production. It is employed by a vast majority of websites and does not require additional support from plug-ins. JavaScript relates back to the focus on HTML and CSS in module one - where HTML and CSS can display rather simple information, JavaScript can allow for more advanced functionality. JavaScript runs in the web browser itself in contrast to PHP, which runs on the web server the site is being hosted on.

While module four was relatively brief in comparison to previous modules, I still learned a lot through use of Codecademy lessons and through taking a quiz on W3Schools. Codecademy covered introductory topics such as basic syntax and programming building blocks such as control flow statements and custom functions. This was by far the most useful part of the module for me, and I will go into more detail in the learning artifact section below.

Learning Artifact

The most important lesson in the Codecademy JavaScript assignments was that covering functions and scope. The concept of scope is important not only in JavaScript but in other programming languages as well, and is the idea that some variables are accessible, or inaccessible, by other parts of the program. A variable with global scope can be accessed by every part of the program, while a variable with functional scope is only accessible inside its function block. In this lesson, the code for which can be seen below, I built a practice JavaScript program that used four different functions that worked in tandem to output an order, how much that order would cost, and how much that order would cost with tax included.


Executing this code results in the output:
Order: thin crust pizza topped with pepperoni
Order: deep dish pizza topped with pineapple
Order: hand tossed pizza topped with garlic
22.5
23.85