什麼是 Camel 命名法? lower camel case: firstName; upper camel case: FirstName var = varible, string, boolean = true, false Number("122.5") convert to number; Number("122.5 years") output NAN; string.substr(start, length); string.indexOf(searchvalue, start) Operators https://www.w3schools.com/jsref/jsref_operators.asp var y = 5; var x = ++y; //Prefix Increment //++y //x=y document.write = y ==> 6 document.write = x ==> 6
var y = 5; var x = --y; //Prefix Decrement //--y //x=y document.write = y ==> 4 document.write = x ==> 4
var y = 5; var x = y++; //Postfix Increment //x=y //y++ document.write = y ==> 6 document.write = x ==> 5
var y = 5; var x = y--; //Postfix Decrement //x=y //y-- document.write = y ==> 4 document.write = x ==> 5
if (condition) { block of code to be executed if the condition is true } else { block of code to be executed if the condition is false }
difference b/w continue & break
for (statement 1; statement 2; statement 3) {
code block to be executed
}
Statement 1 is executed before the loop (the code block) starts.
i = 0;
Statement 2 defines the condition for running the loop (the code block).
i < 5;
Statement 3 is executed each time after the loop (the code block) has been executed.
i++