ee.List.add

Appends the element to the end of list.

UsageReturns
List.add(element)List
ArgumentTypeDetails
this: listList

elementObject

Examples

JavaScript

print(ee.List([]).add('b'));                // ["b"]
print(ee.List(['a']).add('b'));             // ["a","b"]
print(ee.List(['a']).add(ee.String('b')));  // ["a","b"]

print(ee.List(['a']).add(1));             // ["a",1]
print(ee.List(['a']).add(ee.Number(1)));  // ["a",1]

print(ee.List(['a']).add(true));  // ["a",true]

print(ee.List(['a']).add([]));              // ["a",[]]
print(ee.List(['a']).add(ee.List([])));     // ["a",[]]
print(ee.List(['a']).add(['b']));           // ["a",["b"]]
print(ee.List(['a']).add(ee.List(['b'])));  // ["a",["b"]]

print(ee.List(['a']).add(ee.Dictionary()));          // ["a",{}]
print(ee.List(['a']).add(ee.Dictionary({b: 'c'})));  // ["a",{"b":"c"}]

// 0: a
// 1: Image (1 band)
print(ee.List(['a']).add(ee.Image.constant(1)));

// ["a",{"type":"ImageCollection","bands":[]}]
print(ee.List(['a']).add(ee.ImageCollection([])));

Python

# Your example goes here!