select(selector[, arg])

suckgamoni edited this page May 14, 2013 · 1 revision

Projects each element of a sequence into a new form.

Syntax

Parameters

selector

Type: function(value, key, arg)
A transform function to apply to each element.

arg

An external argument.

Return Value

An iterable object whose elements are the result of invoking the transform function on each element of source.


Example

var squares = from.range(1, 11).select("$ * $");
squares.each("console.log($)");

/*
 This code produces the following output:

 1
 4
 9
 16
 25
 36
 49
 64
 81
 100
*/