// From an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new Uint8Array(iterable);