1 | 'use strict';
|
2 | var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
|
3 |
|
4 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
5 | var floor = Math.floor;
|
6 |
|
7 |
|
8 |
|
9 | ArrayBufferViewCore.exportProto('reverse', function reverse() {
|
10 | var that = this;
|
11 | var length = aTypedArray(that).length;
|
12 | var middle = floor(length / 2);
|
13 | var index = 0;
|
14 | var value;
|
15 | while (index < middle) {
|
16 | value = that[index];
|
17 | that[index++] = that[--length];
|
18 | that[length] = value;
|
19 | } return that;
|
20 | });
|