This project is read-only.

concat(second)

Concatenates two sequences.

Syntax

Parameters

second
The sequence to concatenate to the first sequence.
Return Value

An iteratable object that contains the concatenated elements of the two input sequences.

Examples

function getCats()
{
    return [ { name: "Barley", age: 8 },
             { name: "Boots", age: 4 },
             { name: "Whiskers", age: 1 } ];
}

function getDogs()
{
	return [ { name: "Bounder", age: 3 },
             { name: "Snoopy", age: 14 },
             { name: "Fido", age: 9 } ];
}

var cats = getCats();
var dogs = getDogs();

var query = $from(cats).select("$name").concat($from(dogs).select("$name"));

query.each("document.writeln($)");

// This code produces the following output:
//
// Barley
// Boots
// Whiskers
// Bounder
// Snoopy
// Fido

Last edited May 16, 2012 at 3:31 AM by suckgamoni, version 1

Comments

No comments yet.