JavaScript – for…of Statement
The for…of statement loops over the values of any iterable, executing a block of code inside the loop once for each item found.
The for…of statement loops over the values of any iterable, executing a block of code inside the loop once for each item found.
The function statement declares a function to be executed later, when it is called. Functions are objects, and have both properties and methods.
The if…else statement executes a block of code if a specified condition is true, and optionally, another block of code if false.
The let statement declares a variable (container for storing information), and can be empty when declared, with the value assigned later.
The switch statement executes different blocks of code depending on set conditions, and uses the break keyword to break out of the switch block.
The throw statement allows you to generate a custom error (throw an exception), which can be a String, a Number, a Boolean, or an Object.
The try…catch…finally statement handles errors without stopping JavaScript to output the error.
The var statement declares a variable (container for storing information), and can be empty when declared, with the value assigned later.
The while statement defines a code block to be executed for as long as a condition is true.
The Array concat() method joins two or more arrays, returning a new array containing the joined arrays, without changing the existing arrays.
The Array constructor property returns the function that created the Array prototype.
The Array copyWithin() method copies array elements to another position in an array, overwriting the existing values.
The Array entries() method returns an array iterator object that shows the key and value pairs currently existing within the array.
The Array every() method executes a function for each array element, returning true if the function returns true or false.
The Array fill() method fills specified elements in an array with a value, overwriting the original array.
The filter() method creates a new array filled with elements that pass a test provided by a function, leaving the existing array unchanged.
The Array find() method executes a function for each array element and returns the value of the first element that passes a test.
The Array findIndex() method executes a function for each array element, and returns the index (position) of the first element that passes a test.
The Array forEach() method calls a function, running it for each item in an array.
The Array.from() method returns an array from any object with a length property.