Array contains Identifiable - Node.js Array

Node.js examples for Array:Search

Description

Array contains Identifiable

Demo Code


Array.prototype.containsIdentifiable = function (identity) {
    var i = this.length;
    while (i--) {
        if (this[i].identity == identity) {
            return true;
        }/*from ww w  .j av a  2  s .c o  m*/
    }
    return false;
};

Related Tutorials