Javascript Array includes(value)

Description

Javascript Array includes(value)


/**// ww  w  .j a va2  s  . c o  m
 * @include isArrayIncludes
 */
Array.prototype.includes = Array.prototype.includes || function(value){
  return isArrayIncludes(this, value);
};

Javascript Array includes(value)

/* eslint-disable no-extend-native */
Array.prototype.includes = function(value) {
  return this.some(element => element === value)
}
/* eslint-enable no-extend-native */

Javascript Array includes(value)

Array.prototype.includes = Array.prototype.includes || function (value) {
    'use strict';
    for (var i = 0; i < this.length; i++) {
        if (this[i] === value) {
            return true;
        }/*from w  w w .  ja  v a  2 s .c o m*/
    }
    return false;
};



PreviousNext

Related