Example 1 — Official Join Two Lists
Join two arrays into one new array — the list samples from the Ramda docs.
console.log(R.concat([4, 5, 6], [1, 2, 3])); // [4, 5, 6, 1, 2, 3]
console.log(R.concat([], [])); // [] How It Works
- Type check. Both arguments are arrays, so Ramda can join them.
- Order. Items of the first list come first:
4, 5, 6, then1, 2, 3. - Not sorted.
R.concatonly joins; it never reorders items. - Empty is fine. Two empty lists give a new empty list.
