Created
January 29, 2019 13:48
-
-
Save Chuloo/8621237a3978688a8ada2cee047c634e to your computer and use it in GitHub Desktop.
Get item in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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