Chapter 2. Type Conversion

Iron Man, Superman, Batman, Spider-Man, X-Men, and countless other superheroes have many traits in common. Most have a distinctive costume, unwavering morals, underlying motif, secret identity, supervillains to fight, and, of course, extraordinary powers. Those powers may or may not be innate, though. For example, Clark Kent doesn't need his Superman costume to fly, but Tony Stark would drop like a stone without his Iron Man armor.

JavaScript values of object type or array and function subtypes are like Superman or Spider-Man. They innately have extraordinary powers, referred to as members or methods. On the other hand, values of the string, number, or boolean type are like Iron Man or Batman in that they need to put ...

Get JavaScript for Absolute Beginners now with O’Reilly online learning.

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