WARNING: Commenting will automatically update you once I updated.
Welcome to JACE!
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
The statements are executed, one by one, in the same order as they are written.
Add a semicolon at the end of each executable statement:
When separated by semicolons, multiple statements on one line are allowed:
Very often when you write code, you want to perform different actions for different decisions.
You can use conditional statements in your code to do this.
ifto specify a block of code to be executed, if a specified condition is true
elseto specify a block of code to be executed, if the same condition is false
else ifto specify a new condition to test, if the first condition is false
switchto specify many alternative blocks of code to be executed
Comparison and Logical operators are used to test for
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Given that x = 5, the table below explains the comparison operators:
|==||equal too||x == 8|
|===||equal value and equal type||x === 5|
|!=||not equal||x != 8|
|!==||not equal value or not equal type||x !== 5|
|>||greater than||x > 8|
|<||less than||x < 8|
|>=||greater than or equal to||x >= 8|
|<=||less than or equal to||x <= 8|
How Can it be Used
Comparison operators can be used in conditional statements to compare values and take action depending on the result:
Logical operators are used to determine the logic between variables or values.
Conditional (Ternary) Operator
Loop through the properties of an object:
Definition and Usage
The for/in statement loops through the properties of an object.
The block of code inside the loop will be executed once for each property.
loops through a block of code a number of times
loops through the properties of an object
loops through the values of an iterable object
loops through a block of code while a specified condition is true
loops through a block of code once, and then repeats the loop while a specified condition is true
Note: Do not use the for/in statement to loop through arrays where index order is important. Use the for statement instead.
Thanks for reading! Adding more stuff soon!
Added for/in Statement [Section]