Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created July 27, 2023 15:44
Show Gist options
  • Save suhailgupta03/5d2afe51eecf690ae42cadcf50ec934f to your computer and use it in GitHub Desktop.
Save suhailgupta03/5d2afe51eecf690ae42cadcf50ec934f to your computer and use it in GitHub Desktop.
var students = [
"Sudarshan", // 0th index
"Anish", // 1st index
"Chinmay", // 2nd index
"Rahul", // 3rd index
"Tushar",
"Syed",
"Sudarshan",
"Subhrojoti"
];
// students[0] -> "Sudarshan"
// students[1] -> "Anish"
// students[2] -> "Chinmay"
var length = students.length;
for(let i = 0; i < length; i++) {
var studentName = students[i];
console.log(studentName[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment