ee.Number.first

  • first() selects and returns the first provided value (left).

  • It takes two Number arguments: left and right.

  • The function always returns the left value, regardless of the right value.

Selects the value of the first value.

UsageReturns
Number.first(right)Number
ArgumentTypeDetails
this: leftNumberThe left-hand value.
rightNumberThe right-hand value.

Examples

Code Editor (JavaScript)

print(ee.Number(1).first(ee.Number(2)));  // 1

Python setup

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

import ee
import geemap.core as geemap

Colab (Python)

print(ee.Number(1).first(ee.Number(2)).getInfo())  # 1