I wrote some simple code to test the if/else structure in GEE:
var flag = ee.Algorithms.IsEqual(1,5);
print(flag)
if (flag) {
print("this is true");
} else {
print("this is false");
}
the output was:
false;
this is true
Does anyone know how to adjust the above statement to be effective?
if()
if there is no expression to evaluate. Since the JSON string is notnull
it converts totrue
. More on Client vs Server, More on JSif()
and strings.The EE code editor print() function hides some of this semantic