my favorite


JavaScript Chapter One

1. ECMAScript has five primitive types: Undifined, Null, Boolean, Number, and String
2. typeof operator: calling typeof on a variable or value returns one of the following values:
usage: typeof variable

  • undefined (Undefined type)
  • boolean (Boolean type)
  • number (Number type)
  • string (String type)
  • object (Reference type or Null type) (null is considered a placeholder for an object)
3. Undefined type: when a variable is declared and not initialized, it's given value: undefined
the value undefined is also returned when a function doesn't explicitly return a value.

4. Null type: alert(null == undefined); //outputs "true"

5. Boolean type: var a = true, (0 is converted to false when necessary)

6. number type: 32bit integer and 64bit floating-point values. (IEEE 754 format)

No comments:


Taipei, GuTing, Taiwan

huang47 | personal

huang47 | personal