Skip to content

Instantly share code, notes, and snippets.

@Chuloo
Created January 29, 2019 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chuloo/8621237a3978688a8ada2cee047c634e to your computer and use it in GitHub Desktop.
Save Chuloo/8621237a3978688a8ada2cee047c634e to your computer and use it in GitHub Desktop.
Get item in array
const items = ['nail', 'hammer', 'bolt'];
// find array item with index of 1
const atIndex = items.find(function(element, index){
return index === 1
})
// display array item found
console.log(atIndex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment