Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[[["\u003cp\u003e\u003ccode\u003efirst()\u003c/code\u003e selects and returns the first provided value (\u003ccode\u003eleft\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt takes two Number arguments: \u003ccode\u003eleft\u003c/code\u003e and \u003ccode\u003eright\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe function always returns the \u003ccode\u003eleft\u003c/code\u003e value, regardless of the \u003ccode\u003eright\u003c/code\u003e value.\u003c/p\u003e\n"]]],["The `first` method, applied to a Number object, returns the value of the left-hand number. It accepts a right-hand number as an argument but prioritizes the left-hand number's value. For example, when `ee.Number(1).first(ee.Number(2))` is executed, the output is `1`. This method is available in both JavaScript and Python, with the output of the code example demonstrated in each environment.\n"],null,["Selects the value of the first value.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------|---------|\n| Number.first`(right)` | Number |\n\n| Argument | Type | Details |\n|--------------|--------|-----------------------|\n| this: `left` | Number | The left-hand value. |\n| `right` | Number | The right-hand value. |\n\nExamples\n\nCode Editor (JavaScript) \n\n```javascript\nprint(ee.Number(1).first(ee.Number(2))); // 1\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\nColab (Python) \n\n```python\nprint(ee.Number(1).first(ee.Number(2)).getInfo()) # 1\n```"]]