- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
18 lines
760 B
JavaScript
18 lines
760 B
JavaScript
'use strict';
|
|
var toObject = require('../internals/to-object');
|
|
var toAbsoluteIndex = require('../internals/to-absolute-index');
|
|
var lengthOfArrayLike = require('../internals/length-of-array-like');
|
|
|
|
// `Array.prototype.fill` method implementation
|
|
// https://tc39.es/ecma262/#sec-array.prototype.fill
|
|
module.exports = function fill(value /* , start = 0, end = @length */) {
|
|
var O = toObject(this);
|
|
var length = lengthOfArrayLike(O);
|
|
var argumentsLength = arguments.length;
|
|
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
|
|
var end = argumentsLength > 2 ? arguments[2] : undefined;
|
|
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
|
|
while (endPos > index) O[index++] = value;
|
|
return O;
|
|
};
|