select(selector[, arg])

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 iteratable object whose elements are the result of invoking the transform function on each element of source.

Examples

var squares = $range(1, 11).select("$ * $");
squares.each("document.writeln($)");

/*
 This code produces the following output:

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

Last edited May 18, 2012 at 1:06 AM by suckgamoni, version 1

Comments

No comments yet.