Chapter 4 - Javascript in Webdev
Chapter 4 - Javascript in Webdev
JAVASCRIPT
Introduction
• JavaScript is a
case-sensitive
language.
• Comments
Datatype
• JavaScript arrays
• support numbered indexing
• are written with square brackets.
• Array items are separated by commas.
Identifiers and Reserved Words
• You can also assign a value to the variable when you declare
it.
• JS is untyped language. variable can hold a value of any data
type
Variables
• var
• can be re-declared and updated
• You can use the variable before it is declared (called
Hoisting)
• can NOT have block scope - Variables declared inside a { }
block can be accessed from outside the block
• Operator Precedence.
Conditional Statements
• if...else statement