Enumerate method
fruits = ["apple", "watermelon", "lemon"]
fruits.forEach((fruit, index) => console.log(fruit, index))
Note that we didn't need to use anything like enumerate here.Last updated
fruits = ["apple", "watermelon", "lemon"]
fruits.forEach((fruit, index) => console.log(fruit, index))
Note that we didn't need to use anything like enumerate here.Last updated