Right now you are part of the audience. You don’t know much about the performance that is beginning right before your eyes but you can still enjoy its presence. However, you are starting to get curious about what is happening closer to the stage. How are so many different parts of a system able to produce such a intriguing sound? What if you could actually interact with the system at hand?
To start the performance, the conductor must give the orchestra the signal to begin. In JavaScript, we act as the conductor by giving a signal whenever we click, scroll, or hover over an interactive element. Essentially, the web page is our stage and the orchestra is our code that listens for the go ahead to begin an action.
How do the members of the orchestra know what to play when the conductor when the conductor isn’t signaling? It’s actually very simple, a piece of paper called sheet music! In JavaScript, the system is able to use local storage to save a users preferences so that it knows what to display or how to display it before a signal is given.