* Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @par
(array, indexes)
| 6682 | * @returns {Array} Returns `array`. |
| 6683 | */ |
| 6684 | function reorder(array, indexes) { |
| 6685 | var arrLength = array.length, |
| 6686 | length = nativeMin(indexes.length, arrLength), |
| 6687 | oldArray = copyArray(array); |
| 6688 | |
| 6689 | while (length--) { |
| 6690 | var index = indexes[length]; |
| 6691 | array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; |
| 6692 | } |
| 6693 | return array; |
| 6694 | } |
| 6695 | |
| 6696 | /** |
| 6697 | * Gets the value at `key`, unless `key` is "__proto__" or "constructor". |