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 developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #return #object #array #property
ADD COMMENT
Topic
Name
7+5 =