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

1. The JavaScript Language > 1.3. Data Types

Data Types

JavaScript supports three primitive data types: numbers, booleans, and strings; and two compound data types: objects and arrays. In addition, it defines specialized types of objects that represent functions, regular expressions, and dates.

Numbers

Numbers in JavaScript are represented in 64-bit floating-point format. JavaScript makes no distinction between integers and floating-point numbers. Numeric literals appear in JavaScript programs using the usual syntax: a sequence of digits, with an optional decimal point and an optional exponent. For example:

1
3.14
0001
6.02e23

Integers may also appear in hexadecimal notation. A hexadecimal literal begins with 0x:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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