node-xmlreader icon indicating copy to clipboard operation
node-xmlreader copied to clipboard

Something about each

Open SmallAiTT opened this issue 11 years ago • 0 comments

I think, the each function

if(object.array){
    object.each = function(callback){
        for(var i in object.array){
            if(callback(i, object.array[i])) break;
        }
        return;
    }
}

should be changed to be this:

if(object.array){
    object.each = function(callback){
        for(var i in object.array){
            if(callback(i, object.array[i])) break;
        }
        return;
    }
}

so that i can use it like this:

var framesIndex = 0;
myNode.each(function(index, node){
    framesIndex = index;
    if(node.text().toLowerCase() == "aa") return true;
});
console.log(framesIndex);

SmallAiTT avatar Jan 08 '14 08:01 SmallAiTT