Vector2:apply

From Wake
Revision as of 17:38, 1 June 2015 by Redxdev (Talk | contribs) (Created page with "{{VectorX:apply|2}}")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Create a new vector by applying a function to each element of the current vector.

Function

Synopsis

result = Vector2:apply(f)

Arguments

function f

The function to apply to each element. It can take up to 2 arguments, with the first being the element value and the second being the element index.

Returns

Vector2 result

The result of applying the function f to each element of the vector.

See Also