
67
HtmL, JavasCriPt, and Css
A few features of JavaScript programs are different from those of C/ C++. In
JavaScript, data types of variables do not need to be declared. e type of a variable
is automatically determined based on the assigned value. For instance, in Listing 3.6,
BadChars = "/, :;" means that a string is assigned to the variable BadChars,
and the type of this variable automatically becomes string.
In JavaScript, a semicolon (;) is not needed after a sentence. JavaScript has its key-
words or reserved words—that is, words that are not recommended for user- defined
words (see Appendix 3.2).
In JavaScript, you can use “function” to define ...