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

Chapter 2. Details of the Language > Data Types and Variables

Data Types and Variables

Before diving into JavaScript operators, conditionals, and loops, one should understand JavaScript data types and variables. These are building blocks that will be important going forward. Fortunately, JavaScript kept its implementation of data types simple and easy to use, unlike other programming languages. In addition to simple data types, variables are much easier to work with because there are no restrictions on the types of values they can hold.

Numbers

JavaScript's approach to numbers is different from other languages, because every number is treated as a floating-point number. This does not imply that JavaScript does not support integers, octal, hexadecimal, and so on. These numbers are supported at a high level, but, at the lowest level, JavaScript sees numbers as floating-point numbers. The following sections discuss different formats numbers can have at the higher level.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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