from
const doubled = Int32Array.from([1, 2, 3], x => x * 2); // Int32Array [2, 4, 6]
Pass a map function as the second argument to transform values during creation.
Use the map function argument of from() to transform each element.