Use forEach over for loop
Use forEach over for loop Prefer forEach over for loop for simple iterations: const numbers = [1, 2, 3, 4, 5]; numbers.forEach(number => console.log(number)); The forEach method is called on the numbers array. The first argument to forEach is a callback function, which is executed for each element in the array. The callback function takes … Read more