Thursday, August 21, 2014

Get Item count in array using jquery

   GetItemCountInArray: function (myArr, item) {

        num = 0;
        for (i = 0; i <= myArr.length; i++) {
            if (myArr[i] == item)
                num++;
        }
        return num;

    }

No comments:

Post a Comment