Here you can find the source of includes(val)
Array.prototype.includes = function (val) { var returnValue = false; this.forEach(function (el, i){ if (val === el) { returnValue = true;//from ww w . j a v a2s . co m } }); return returnValue; }; var Student = function(name){ this.name = name; this.courses = []; this.courseLoad = {}; }; Student.prototype.enroll = function(course) { if (!this.courses.includes(course)) { this.courses.push(course); this.courseLoad[course.name] = course.numCredits course.add_student(this); } }; var Course = function(name, department, numCredits, day, time) { this.name = name; this.department = department; this.numCredits = numCredits; this.day = day; this.time = time; this.students = []; }; Course.prototype.add_student = function(student){ this.students.push(student); };
if (![].includes) { Array.prototype.includes = function(searchElement ) { if (this === undefined || this === null) { throw new TypeError('Cannot convert this value to object'); var O = Object(this); var len = parseInt(O.length, 10) || 0; if (len === 0) { return false; ...
if (!Array.prototype.includes) { Array.prototype.includes = function(searchElement ) { 'use strict'; if (this == null) { throw new TypeError('Array.prototype.includes called on null or undefined'); var O = Object(this); var len = parseInt(O.length, 10) || 0; if (len === 0) { ...
Array.prototype.includes = function(searchElement) { var O = Object(this); var len = parseInt(O.length) || 0; if (len === 0) { return false; var n = parseInt(arguments[1]) || 0; var k; if (n >= 0) { ...
Array.prototype.includes = function (target) { var result = false this.forEach(function (el) { if (el == target) { result = true }); return result;
Array.prototype.includes = function(target) { for(var i in this) { if(this[i] === target) { return true; }; }; return false; };
var bubbleSort = function (arr) { var notSorted = true while (notSorted) { notSorted = false; for (var i = 0; i <= arr.length-2; i++) { var j = i+1; if (arr[j] < arr[i]) { var temp = arr[j]; arr[j] = arr[i]; ...
Array.prototype.includes = function(val, from) { return this.indexOf(val, from) !== -1;
window.IS_ELECTRON = window.process ? true : false if (!window.IS_ELECTRON) window.require = () => ({}) Array.prototype.includes = function(value) { return this.some(element => element === value)
Array.prototype.includes = function(value) { return jQuery.inArray(value, this) > -1;