let arr = [
{src: "1.jpg", thumb: "1.jpg"},
{src: "2.jpg", thumb: "2.jpg"},
{src: "3.jpg", thumb: "3.jpg"},
{src: "4.jpg", thumb: "4.jpg"},
{src: "5.jpg", thumb: "5.jpg"},
{src: "6.jpg", thumb: "6.jpg"},
];
let model = "4.jpg", index = -1;
for(var i = 0; i < arr.length; i++) {
if(arr[i].src == model) { index = i; break;}
}
alert(index);