Learning Goals
1. Mastering The application of the length attribute
2. Mastering The nesting of If statements
Length
Syntax:string.length
function: Gets The length of string strings
return value: Number
JavaScript Conditional Statements
Learning Goals
1. Learn how to get the week
2. Mastering document.write ()
3. Mastering the Conditional statement switch
Get Week
syntax:new Date (). GetDay ()
Function: Get Week
return Value: Number(0-6)
Output
Syntax:document.write ("content")
Function: output content to browser
Switch statement
syntax: switch (expression) {
Case Value:statement
Break
Case Value:statement
Break
......
Default:statement
}
JavaScript Loop Statements
Learning Goals
1. Mastering The syntax structure for a for statement
2. Mastering The application logic for the For statement
For statement
Grammar:
For(statement 1; statement 2; statement 3){
the code block that is executed;
}
Statement 1: Execute before Loop (code block) starts
Statement 2: Define conditions for running loops (code blocks)
Statement 3: Executes after a loop (code block) has been executed
JavaScript Conditional Statement-5