CpSc 217 - Structured and Dynamic Web Programming
The notes found on these pages all reference the textbook given above.
Unless otherwise stated, the citation of the information on these web pages
is that text.
This chapter is a review of cpsc130 with the exception of array and
object initializers that you may have seen in cpsc146
Basic Javascript
- Characters
- Comments
- /* anything */
- Literals
-
- Strings ("hello", 'hello'), Numbers (1, 2.4), boolean (true, false), nAn,
null
- Identifiers: start with letter, contain letters and digits and underscores
- Reserved words: if .... See section 2.4.1, page 24
- Semicolons are optional
-
Review from 130
-
Array initializer
- [1,2,3,4,5]
- initializes an array of 5 elements. Indices 0 to 4
-
Object initializer
- { x:1, y:2}
- initializes an object with two elements named x and y. x has
a value of 1 and y has a value of 2