Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Find Index in Array

$scope.indexOfField = function(fieldId) {
    var fieldData = $scope.model.fieldData, 
        i = 0, ii = $scope.model.fieldData.length;
    for(i; i < ii; i++) if(fieldData[i].Id === fieldId) break;
    // use i
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Find #Index #Array
ADD COMMENT
Topic
Name
9+5 =