Snippets Collections
const myArray = ['rock', 'paper', 'scissors'];

for(item of myArray){
        const index = myArray.indexOf(item);
        console.log(index)
    
}
star

Sun Apr 16 2023 22:18:18 GMT+0000 (Coordinated Universal Time)

#javascript #forof #loop #index

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension