Use the built-in forEach() method to loop through an array with one line of code.
Basics
JavaScript Objects Explained
JavaScript objects are variables that contain multiple data values. The values within a JS object are known as properties. Objects use keys to name values, much like how is done with variables.
JavaScript Arrays Explained
Arrays are container-like values that can hold other values. The values inside an array are called elements.
One-Liner If-Else Statements
Instead of writing an if-else on multiple lines, you can use the ternary operator to write the whole statement with one line of code.
Javascript Conditionals Explained
Conditional statements control behavior in JavaScript and determine whether or not pieces of code can run.
JavaScript Functions Explained
JavaScript functions are reusable blocks of code that perform a specific task, taking some form of input and returning an output.
JavaScript Variables Explained
Variables are named values and can store any type of JavaScript value.
JavaScript Operators Explained
Operators are the symbols between values that allow different operations like addition, subtraction, multiplication, and more.
JavaScript Booleans Explained
A boolean value is one that can either be TRUE or FALSE. If you need to know “yes” or “no” about something, then you would want to use the boolean function.
JavaScript Strings Explained
In JavaScript, Strings are values made up of text and can contain letters, numbers, symbols, punctuation, and even emojis!