Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

es.typed-array.reverse.js 658B

123456789101112131415161718192021
  1. 'use strict';
  2. var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
  3. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  4. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  5. var floor = Math.floor;
  6. // `%TypedArray%.prototype.reverse` method
  7. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse
  8. exportTypedArrayMethod('reverse', function reverse() {
  9. var that = this;
  10. var length = aTypedArray(that).length;
  11. var middle = floor(length / 2);
  12. var index = 0;
  13. var value;
  14. while (index < middle) {
  15. value = that[index];
  16. that[index++] = that[--length];
  17. that[length] = value;
  18. } return that;
  19. });