Reading Notes 07
Skim
Expressions and Operators
Operators are the comparison and assignment symbols used when assigning a varibale. There are many kinds of operators:
- Assignment Operators
- Comparison Operators
- Arithmetic Operators
- Bitwise Operators
- Logical Operators
- String Operators
- Conditional (ternary) Operator
- Comma Operator
- Unary Operators
- Relational Operators
All these can be found here.
A second helpful link for Javascript operators is the W3schools site.
Functions
Functions are small code blocks made for a specific function, hence the neame. Go here to look at how to structure and use a function.
Read
MDN Control Flow
Control flow is the order of execution of a script. Code is always run top to bottom of a page unless the computer runs into conditionals, loops and functions. For example, conditional structures are the if, else, else if, and switch scripts which change what the program does depending on a boolean statement.
Read and Demo
Functions W3
As stated above, Javascript functions are blocks of code made to perform a task. They are similar to classes but have a more specific function. A function is defined by the function keyword and is followed by a name, parentheses, and curly brackets which hold the instructions. The parentheses may contain parameters seperated by commas. These parameters are inpurts that wil be used within the function.