jsbook icon indicating copy to clipboard operation
jsbook copied to clipboard

第4页,Prototype.js $A 方法源码在1.7版本已经更新

Open ngot opened this issue 10 years ago • 0 comments

代码更新:

            function $A(iterable) {
              if (!iterable) return [];
              // Safari <2.0.4 crashes when accessing property of a node list with property accessor.
              // It nevertheless works fine with `in` operator, which is why we use it here
              if ('toArray' in Object(iterable)) return iterable.toArray();
              var length = iterable.length || 0, results = new Array(length);
              while (length--) results[length] = iterable[length];
              return results;
            }

ngot avatar May 02 '14 10:05 ngot