Book Image

Object-Oriented JavaScript

Book Image

Object-Oriented JavaScript

Overview of this book

Table of Contents (18 chapters)
Object-Oriented JavaScript
Credits
About the Author
About the Reviewers
Preface
Built-in Functions
Regular Expressions
Index

Primitive Data Types Recap


Let's quickly summarize what has been discussed so far:

  • There are five primitive data types in JavaScript:

    • number

    • string

    • boolean

    • undefined

    • null

  • Everything that is not a primitive is an object

  • The number data type can store positive and negative integers or floats, hexadecimal numbers, octal numbers, exponents, and the special numbers NaN, Infinity, and –Infinity

  • The string data type contains characters in quotes

  • The only values of the boolean data type are true and false

  • The only value of the null data type is the value null

  • The only value of the undefined data type is the value undefined

  • All values become true when converted to a boolean, with the exception of the six falsy values:

    • ""

    • null

    • undefined

    • 0

    • NaN

    • false