I am trying to ge to see if an array has an exact match to a value. This is what I have so far but it doesn't work. If I search for 'leo' I should get no result but in this case both items in the array both match the value. Does anyone know how to find if there is an exact match in the array? Thanks
var array = ['leon','leonardo'];
array.indexOf('leo')
indexOf()gives-1for me. jsfiddle.net/WX737