TEXT   17

some

Guest on 1st May 2022 04:33:30 PM

  1. var some;
  2. if (Array.prototype.some) {
  3.     some = Array.prototype.some;
  4. } else {
  5.     some = function (fun) {
  6.         var t = Object(this),
  7.             len = t.length >>> 0,
  8.             i;
  9.  
  10.         for (i = 0; i < len; i++) {
  11.             if (i in t && fun.call(this, t[i], i, t)) {
  12.                 return true;
  13.             }
  14.         }
  15.  
  16.         return false;
  17.     };
  18. }
  19.  
  20. export { some as default };

Raw Paste


Login or Register to edit or fork this paste. It's free.