ee.Array.abs

Stay organized with collections Save and categorize content based on your preferences.
On an element-wise basis, computes the absolute value of the input.

UsageReturns
Array.abs()Array
ArgumentTypeDetails
this: inputArrayThe input array.

Examples

Code Editor (JavaScript)

print(ee.Array([-1]).abs());  // [1]
print(ee.Array([-2, 0, 2]).abs());  // [2,0,2]
print(ee.Array([[-3.1, -2], [-1, 0]]).abs());  // [[3.1,2],[1,0]]