[javascript] indexOf method in an object array?