const names=["shirshak","Bigyan","Savyata"]; for(let name of names){ console.log(name); //output all name console.log(names.indexOf(name)); // index 0,1,2 }