HTML and CSS Reference
Values passed to
Functions are called using the function name, followed by parentheses. If you are passing
arguments to a function, they are included in the parentheses in a comma-separated list.
Even if you're not using arguments, the parentheses are still required. This is true
whether you're calling a function you wrote yourself or a function that's built in to
Strings, like "Teach Yourself Web Publishing".
Boolean values (true or false).
Numbers, integer or decimal.
null , which is used to represent an unknown or missing value.
undefined , the value associated with variables that have been declared but have
not yet had a value assigned to them.
convert data to whatever type it needs in a given context. So if you take a Boolean value
some cases, this automatic conversion process can lead to odd results. For example, if
you try to use a value that's not a number in a context where a number is expected,
var squareRoot = Math.sqrt(“a string”); // The value of squareRoot is NaN
Boolean values represent a state of either true or false. You've already seen some exam-
ples that involve boolean values. For example, if statements and while loops require
can ultimately be converted to a Boolean. The values that are treated as false are the
number zero, empty strings, null , undefined , and NaN . Everything else is true.