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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.