Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return object from array by property value

function variableName(value) {
    for (var i=0, iLen=array.length; i<iLen; i++){
        if (array[i].property == value) return array[i]
    }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #return #object #array #property
ADD COMMENT
Topic
Name
2+4 =