Nodejs Array Some someArray.prototype.some || (fun /*, thisp */)

Here you can find the source of someArray.prototype.some || (fun /*, thisp */)

Method Source Code

Array.prototype.some = Array.prototype.some || function(fun /*, thisp */) {
  "use strict";/*ww w  .j av  a 2 s.c o m*/
  if (this === void 0 || this === null) throw new TypeError();
  var t = Object(this);
  var len = t.length >>> 0;
  if (typeof fun !== "function") throw new TypeError();
  var thisp = arguments[1];
  for (var i = 0; i < len; i++) {
    if (i in t && fun.call(thisp, t[i], i, t)) return true;
  }
  return false;
};

Related

  1. some(fun /*, thisArg */)
    Array.prototype.some = Array.prototype.some || function(fun ) {
        'use strict';
        if (this === void 0 || this === null)
            throw new TypeError();
        var t = Object(this);
        var len = t.length >>> 0;
        if (typeof fun !== 'function')
            throw new TypeError();
        var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
    ...
    
  2. some(fun /*, thisp*/)
    Array.prototype.some = function(fun ) {
        var len = this.length;
        if (typeof fun != "function") {
            throw new TypeError();
        var thisp = arguments[1];
        for (var i = 0; i < len; i++) {
        if (i in this && fun.call(thisp, this[i], i, this))
            return true;
    ...
    
  3. some(fun /*, thisp*/)
    Array.prototype.some = Array.prototype.some || function(fun ) {
        var i = 0,
            len = this.length >>> 0;
        if (typeof fun != "function") {
            throw new TypeError();
        var thisp = arguments[1];
        for (; i < len; i++) {
            if (i in this &&
    ...
    
  4. some(fun, thisArg)
    Array.prototype.some = function(fun, thisArg) {
      "use strict";
      var i, len, t;
      if (this === void 0 || this === null) {
        throw new TypeError();
      t = Object(this);
      len = t.length >>> 0;
      if (typeof fun !== "function") {
    ...
    
  5. some(iterator)
    Array.prototype.some = function(iterator) {
      for (var i = 0, len = this.length; i < len; i++) {
        if (iterator(this[i], i)) {
          return true;
      return false;
    };
    
  6. someMethod()
    Array.prototype.someMethod = function() {
        return 'this is just a test';
    };
    export {Array};
    
  7. someSyncasync (callback, thisArg)
    Array.prototype.someSync = async function (callback, thisArg) {
      for (let [index, item] of Object.entries(this)) {
        if (await callback(item, index, this)) return true
      return false