Sha256: 4a24889ef66777e505cc7764e39c734bb34418e481509a3cad4f240dd829b1a8
Contents?: true
Size: 858 Bytes
Versions: 62
Compression:
Stored size: 858 Bytes
Contents
/* */ 'use strict'; var $def = require('./$.def'), toObject = require('./$.to-object'), toIndex = require('./$.to-index'), toLength = require('./$.to-length'); $def($def.P, 'Array', {copyWithin: function copyWithin(target, start) { var O = toObject(this), len = toLength(O.length), to = toIndex(target, len), from = toIndex(start, len), end = arguments[2], fin = end === undefined ? len : toIndex(end, len), count = Math.min(fin - from, len - to), inc = 1; if (from < to && to < from + count) { inc = -1; from = from + count - 1; to = to + count - 1; } while (count-- > 0) { if (from in O) O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }}); require('./$.unscope')('copyWithin');
Version data entries
62 entries across 31 versions & 1 rubygems