vectorize a one parameter function
const abs = (v) => v >= 0 ? v : -vconst arr = new Float32Array(10_000).map(() => 123 * (Math.random() - 0.5))vectorize1(abs, arr, arr) // `arr` is now filled with absolute valued random numbers Copy
const abs = (v) => v >= 0 ? v : -vconst arr = new Float32Array(10_000).map(() => 123 * (Math.random() - 0.5))vectorize1(abs, arr, arr) // `arr` is now filled with absolute valued random numbers
Rest
vectorize a one parameter function
Example