indexOf()
Learned from: Codewars
Lang: JavaScript
Purpose: Finds the index/position of definted item(s) from an array
Example use:
function findNeedle(haystack) {
return "found the needle at position " + haystack.indexOf("needle");
}
//or
const findNeedle = haystack => `found the needle at position ${haystack.indexOf('needle')}`;