Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

concat(second)

suckgamoni edited this page · 1 revision

Concatenates two sequences.

Syntax

Parameters

second

The sequence to concatenate to the first sequence.

Return Value

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


Example

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();

from(cats)
    .select("$name")
    .concat(from(dogs).select("$name"))
    .each("console.log($)");

// This code produces the following output:
//
// Barley
// Boots
// Whiskers
// Bounder
// Snoopy
// Fido
Something went wrong with that request. Please try again.