JS Tutorial

Welcome!

Welcome to my JavaScript tutorial on switch statements. In this tutorial we will be building an application to calculate and display the notes of a musical chord using switch statements. The user can select any scale and chord quality combination and this JavaScript program will calculate the notes that make up that chord. Let's get started by first getting familiar with the JavaScript language.

What Is JavaScript?

JavaScript is a programming language used for building applications on the web. It is the only programming language you can use to write front end code. What is front end code? I'm glad you asked. Simply put, front end code is the code that controls what is presented to the user, while back end code is the code on the server side that supports it.

Why Learn JavaScript?

JavaScript allows you to incorporate user interaction on your web pages. It transforms your web site from a collection of static pages to an interactive experience. With HTML and CSS, your web pages are static, like an ebook, but with JavaScript those same pages have similar functionality to software applications. They become dynamic.

How It Works

In short, something triggers an event, such as a user clicking a button, and then the browser responds to that event according to the instructions in the JavaScript code. There are many ways to trigger an events. Hovering over an image can trigger an event. A timer on an internal clock going off can trigger an event. As the developer, you write the instructions necessary to create the interactive experiences you want to happen on a web page, and then attach those instructions to events.

Starting at the End

In this tutorial, I am going to start at the end. Before we write the instructions for the interactions we want the browser to execute on the page, we are first going to learn how to write the code that tells the browser to "listen" for and "call" your instruction. If you're ready to get started on our JavaScript journey, click the "Next" button in the lower right corner of your screen. See you on the next page!