mirror of
https://github.com/Doodle3D/Doodle3D-API
synced 2024-06-27 14:11:21 +02:00
18 lines
508 B
JavaScript
18 lines
508 B
JavaScript
/* */
|
|
'use strict';
|
|
var $ = require("./$"),
|
|
$def = require("./$.def"),
|
|
assertFunction = require("./$.assert").fn;
|
|
$def($def.P + $def.F, 'Array', {turn: function(fn, target) {
|
|
assertFunction(fn);
|
|
var memo = target == undefined ? [] : Object(target),
|
|
O = $.ES5Object(this),
|
|
length = $.toLength(O.length),
|
|
index = 0;
|
|
while (length > index)
|
|
if (fn(memo, O[index], index++, this) === false)
|
|
break;
|
|
return memo;
|
|
}});
|
|
require("./$.unscope")('turn');
|