4.5 DATA TYPES

It is thought that JavaScript lacks the rigor of other languages as compared to Java or C# because they are strongly typed. JavaScript is indeed not a strongly typed language so that makes it flexible and easier to code but on the flip side they are difficult to maintain because of the lack of typing. However, the client-side JavaScripts are shorter in size, and hence the rigor is actually not necessary thus benefiting in the overall context. Having said that, the types of values that JavaScript can handle, called Datatypes, can be thought of as being organized as follows.

  • Primitive Datatypes
    • Numbers
    • Strings
    • Boolean
  • Trivial Datatypes
    • Null
    • Undefined (variable not declared is undefined, or a variable declared but not initialized) ...

Get Web Technology: Theory and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.