Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

array-to-reversed.js 419B

123456789101112
  1. 'use strict';
  2. var lengthOfArrayLike = require('../internals/length-of-array-like');
  3. // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
  4. // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed
  5. module.exports = function (O, C) {
  6. var len = lengthOfArrayLike(O);
  7. var A = new C(len);
  8. var k = 0;
  9. for (; k < len; k++) A[k] = O[len - k - 1];
  10. return A;
  11. };