O'Reilly logo

JavaScript Absolute Beginner’s Guide by Kirupa Chinnathambi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2. Values and Variables

In This Chapter

Learn how to use values to store data

Organize your code with variables

Get a brief look at variable naming conventions

In JavaScript, every piece of data that you provide or use is considered to contain a value. In the example you saw from our introduction in the previous chapter, the words hello, world! might just be some words that you pass in to the alert function:

alert("hello, world!");

To JavaScript, these words and punctuation marks have a specific representation under the hood. They are considered values. You may not have thought much about that when you were typing those words in, but when you are in JavaScript country, every piece of data you touch is considered a value.

Now, why is knowing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required