esnext.array.to-reversed.js 569 B

1234567891011121314151617
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var arrayToReversed = require('../internals/array-to-reversed');
  4. var toIndexedObject = require('../internals/to-indexed-object');
  5. var addToUnscopables = require('../internals/add-to-unscopables');
  6. var $Array = Array;
  7. // `Array.prototype.toReversed` method
  8. // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
  9. $({ target: 'Array', proto: true }, {
  10. toReversed: function toReversed() {
  11. return arrayToReversed(toIndexedObject(this), $Array);
  12. }
  13. });
  14. addToUnscopables('toReversed');