Functions allow you to divide your code into blocks which can be executed multiple times in your program. Writing functions helps reduce repetition and improves the readability of a program. The console allows you to keep track of what your program is doing.
Arrow functions are a newer way of declaring functions. Arrow functions, sometimes referred to as "fat arrow" functions, are more concise and therefore easier to read than traditional functions.
Lists allow you to store multiple similar values in one variable. For instance, a program could store a list of user names, or a list of cookies sold at a local bakery, all in one variable.
Objects allow you to store multiple properties about a certain value.
Conditional statements allow you to control the flow of your program. They evaluate an expression and run a block of code depending on the outcome of that expression. Loops, on the other hand, allow you to automate repetitive tasks.
Similar to the for loop, the JS forEach loop runs a block of code for each item in an iterable object. You can use a forEach loop to go through a list, a string, an object, or another iterable.
- Manipulate the contents of a page using innerText and innerHTML
- Use date and time in your programs
- Use the querySelector method
- Work with JS default parameters in your functions