@davidcal/fec-raptorq
Version:
Node.js wrapper for RaptorQ forward error correction
27 lines (22 loc) • 367 B
JavaScript
/**
* @stability 3 - stable
*
* Iterates an array in reverse.
*/
export const iter_array_reverse = (arr) => {
return {
[Symbol.iterator]: () => {
let idx = arr.length;
return {
next: () => {
idx--;
return {
done: idx < 0,
value: arr[idx],
};
},
};
},
};
};
export const iterArrayReverse = iter_array_reverse;