4.8 For...of Loops
So, as I told you in the last video, from the ecma 6 or ES6 script, we have a new way to iterate using the for of loop. It's very similar to the for in loop but instead of the in keyword, we use the of keyword. So here is an example, let's do a for let color of colors with an s Then we make a color consol.log and save the changes. You can see with this new for loop, we don't have to manage this index. We don't need to access this element at the given index. So, at each iteration, this color which is our loop variable will contain one of the elements of this array. So, when I save the changes, you see red green and blue To sum up, we use the for in loop to iterate on the properties of an object and the for of loop to iterate on the elements or items of an array. That's it for this little demonstration on for...of loops, let's meet again for a very next video.