About This Product
FontsMadeEasy.com
 
Search This Database:
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet
Tutorial archive
General Questions
Javascript 1.2
Navigation
Numbers
Strings
Object Model
Reference Manual
Dialog
Windows
Frames
Forms
Images
Mouse Events
Colors
File Access
Control Status Bar
Dates and Time
Cookies
Client Information
Bookmarklets


Constants

Question: What types of numbers can I use in JavaScript code?

Answer: In JavaScript code, you can use the following forms of numbers:

  • conventional decimal numbers:
    5 137 1.3
  • decimal numbers in exponential form:
    6.67e-11
    -1.127e20
  • octal numbers, for example:
    01234 -077 0312
    Positive octal numbers must begin with 0 (zero) and negative octal numbers must begin with -0.
  • hexadecimal numbers, for example:
    0xFF -0xCCFF 0xabcdef
    Positive hexadecimals must begin with 0x and negative hexadecimals must begin with -0x.

BackBack