• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. Introduction to JavaScript > Working with Variables

Working with Variables

In your scripts, you’ll work with two basic types of data: literals and variables. Literals are simply values that don’t change, such as 5 or "Love hurts" or 6.02. These represent different types of values that you can use directly in the assignments and computations (both of which, together, are called expressions in programming) that make up your script.

You’ve already had a brief introduction to variables in JavaScript, but they’re worth looking at a bit more closely. Variables in JavaScript are probably easier to work with than those in many other programming and scripting languages, because you don’t need to be explicit about declaring the variables and setting them with a certain type. You’ll find that there are four types of values that you can work with in JavaScript: integers, floating-point numbers, text strings, and Boolean values.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint