Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
submission report
Commit Description:
submission report
'use strict' ;
// https://tc39.github.io/proposal-setmap-offrom/
var $export = require ( './_export' );
var aFunction = require ( './_a-function' );
var ctx = require ( './_ctx' );
var forOf = require ( './_for-of' );
module . exports = function ( COLLECTION ) {
$export ( $export . S , COLLECTION , { from : function from ( source /* , mapFn, thisArg */ ) {
var mapFn = arguments [ 1 ];
var mapping , A , n , cb ;
aFunction ( this );
mapping = mapFn !== undefined ;
if ( mapping ) aFunction ( mapFn );
if ( source == undefined ) return new this ();
A = [];
if ( mapping ) {
n = 0 ;
cb = ctx ( mapFn , arguments [ 2 ], 2 );
forOf ( source , false , function ( nextItem ) {
A . push ( cb ( nextItem , n ++ ));
});
} else {
forOf ( source , false , A . push , A );
}
return new this ( A );
} });
};
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings