To get first object from array of objects by a specific property value:
function getObjectFromObjectsArrayByPropertyValue(objectsArray, propertyName, propertyValue) {_x000D_
return objectsArray.find(function (objectsArrayElement) {_x000D_
return objectsArrayElement[propertyName] == propertyValue;_x000D_
});_x000D_
}_x000D_
_x000D_
function findObject () {_x000D_
var arrayOfObjectsString = document.getElementById("arrayOfObjects").value,_x000D_
arrayOfObjects,_x000D_
propertyName = document.getElementById("propertyName").value,_x000D_
propertyValue = document.getElementById("propertyValue").value,_x000D_
preview = document.getElementById("preview"),_x000D_
searchingObject;_x000D_
_x000D_
arrayOfObjects = JSON.parse(arrayOfObjectsString);_x000D_
_x000D_
console.debug(arrayOfObjects);_x000D_
_x000D_
if(arrayOfObjects && propertyName && propertyValue) {_x000D_
searchingObject = getObjectFromObjectsArrayByPropertyValue(arrayOfObjects, propertyName, propertyValue);_x000D_
if(searchingObject) {_x000D_
preview.innerHTML = JSON.stringify(searchingObject, false, 2);_x000D_
} else {_x000D_
preview.innerHTML = "there is no object with property " + propertyName + " = " + propertyValue + " in your array of objects";_x000D_
}_x000D_
}_x000D_
}
_x000D_
pre {_x000D_
padding: 5px;_x000D_
border-radius: 4px;_x000D_
background: #f3f2f2;_x000D_
}_x000D_
_x000D_
textarea, button {_x000D_
width: 100%_x000D_
}
_x000D_
<fieldset>_x000D_
<legend>Input Data:</legend>_x000D_
<label>Put here your array of objects</label>_x000D_
<textarea rows="7" id="arrayOfObjects">_x000D_
[_x000D_
{"a": 1, "b": 2},_x000D_
{"a": 3, "b": 4},_x000D_
{"a": 5, "b": 6},_x000D_
{"a": 7, "b": 8, "c": 157}_x000D_
]_x000D_
</textarea>_x000D_
_x000D_
<hr>_x000D_
_x000D_
<label>property name: </label> <input type="text" id="propertyName" value="b"/>_x000D_
<label>property value: </label> <input type="text" id="propertyValue" value=6 />_x000D_
_x000D_
</fieldset>_x000D_
<hr>_x000D_
<button onclick="findObject()">find object in array!</button>_x000D_
<hr>_x000D_
<fieldset>_x000D_
<legend>Searching Result:</legend>_x000D_
<pre id="preview">click find</pre>_x000D_
</fieldset>
_x000D_