Creates a new vector by applying a function component-wise to the components of one or more input vectors.
The function to apply to each component.
Rest
The vectors.
The resulting vector.
apply((a, b) => a + b, [1, 2, 3], [4, 5, 6]); // [5, 7, 9] Copy
apply((a, b) => a + b, [1, 2, 3], [4, 5, 6]); // [5, 7, 9]
apply((i) => i * 2, [1, 2, 3]); // [2, 4, 6] Copy
apply((i) => i * 2, [1, 2, 3]); // [2, 4, 6]
apply((a, b) => a + (b - a) / 2, [1, 2, 3], [4, 5, 6]); // [2.5, 3.5, 4.5] Copy
apply((a, b) => a + (b - a) / 2, [1, 2, 3], [4, 5, 6]); // [2.5, 3.5, 4.5]
Creates a new vector by applying a function component-wise to the components of one or more input vectors.