JS Built-ins
TypedArrayfromintermediate

Int32Array.from() with Map Function

πŸ“– Usage Example
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.

πŸ’‘ Hints (1)
  • β€’ Int32Array.from(array, x => x * 2)