CSPP552: Web Programming, JavaScript part 4
JavaScript Basic Language
- Example literals: 8.5, 34, "foo",
'bar', and false
- Identifiers: Just about any string that doesn't start with ".", e.g.
i, foo, foo2, whatEver
- Semicolons optional at the end of lines
- Types: Numbers, strings, booleans, functions, objects (sort of), arrays,
and Null.
- Declare variables: var foo = stuff
- Variable declaration is optional, but advised
- Operators: like C, one notable addition: + for string
concatentation
- "foo" + "bar" == "foobar"
- Case-sensitive (blah is not BLAH)
Next