Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created May 12, 2023 16:39
Show Gist options
  • Save suhailgupta03/ec5f7ceca1731768b9d17c0b8d7c1b48 to your computer and use it in GitHub Desktop.
Save suhailgupta03/ec5f7ceca1731768b9d17c0b8d7c1b48 to your computer and use it in GitHub Desktop.
var topNStudents = [
'manoj',
'ramesh',
'garima',
'ashish',
'saru',
'tanya'
];
console.log(topNStudents[1]); // Accessing the first index or the second entry
topNStudents.push('sagar'); // this basically
// creates one more entry into array
console.log(topNStudents);
topNStudents.pop(); // remove the last entry
console.log(topNStudents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment