On an element-wise basis, subtracts the second value from the first.
Usage | Returns |
---|---|
Array.subtract(right) | Array |
Argument | Type | Details |
---|---|---|
this: left | Array | The left-hand value. |
right | Array | The right-hand value. |
Examples
Code Editor (JavaScript)
print(ee.Array([10]).subtract(1)); // [9] print(ee.Array([-1, 0, 1]).subtract(2)); // [-3,-2,-1] print(ee.Array([-1, 0, 1]).subtract([-5, 6, 7])); // [4,-6,-6] var empty = ee.Array([], ee.PixelType.int8()); print(empty.subtract(empty)); // []