Chapter 2. JavaScript Basics

Now it’s time to learn the basics of javascript. This chapter and the next two chapters on objects and events combine simple examples with general discussion about how the various aspects of JavaScript work. In later chapters, I will bring these ideas together in practical and useful ways.

When I am asked how programming works, my simple reply is: There is data, and there is code that acts on data. Most of this chapter is divided into two sections around this thought. First, you will see all the ways that data can be stored within JavaScript. Second, you will see all the code structures that allow you to run various kinds of tests and processes on that data. These code structures make up the basic building blocks of ...

Get Scriptin’ with JavaScript and Ajax: A Designer’s Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.