Either use a simple for
-loop:
var result = null;
for (var i = 0; i < array.length; i++) {
if (array[i].name === "string 1") {
result = array[i];
break;
}
}
Or if you can, that is, if your browser supports it, use Array.filter, which is much more terse:
var result = array.filter(function (obj) {
return obj.name === "string 1";
})[0];