Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.List.cat

  • TheList.cat(other) method concatenates the contents of another list onto the end of the current list.

  • Both thethis list and theother list must be of typeList.

  • The method returns a newList containing the concatenated elements.

  • Examples demonstrate concatenating lists with various elements, including nested lists and empty lists.

Concatenates the contents of other onto list.

UsageReturns
List.cat(other)List
ArgumentTypeDetails
this:listList
otherList

Examples

Code Editor (JavaScript)

print(ee.List(['dog']).cat(['squirrel']));// ["dog","squirrel"]print(ee.List(['moose']).cat(['&','squirrel']));// ["moose","&","squirrel"]print(ee.List([['a','b']]).cat(ee.List([['1',1]])));// [["a","b"],["1",1]]print(ee.List([]).cat(ee.List([])));// []print(ee.List([1]).cat(ee.List([])));// [1]print(ee.List([]).cat(ee.List([2])));// [2]

Python setup

See the Python Environment page for information on the Python API and usinggeemap for interactive development.

importeeimportgeemap.coreasgeemap

Colab (Python)

display(ee.List(['dog']).cat(['squirrel']))# ['dog', 'squirrel']# ['moose', '&', 'squirrel']display(ee.List(['moose']).cat(['&','squirrel']))# [['a', 'b'], ['1', 1]]display(ee.List([['a','b']]).cat(ee.List([['1',1]])))display(ee.List([]).cat(ee.List([])))# []display(ee.List([1]).cat(ee.List([])))# [1]display(ee.List([]).cat(ee.List([2])))# [2]

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-10-06 UTC.