❔ is this syntax correct

IsUp is a method that gets an array and returns whether it's ordered is a rising way. But it doesn't matter, is this syntax correct? I'm trying to return true if both s and tmp r rising. I'd usually write it as 2 different sections and connecting them w && but I tried this way js bc it's used in math and it doesn't give me any errors but idk if it'll function the way I want it to
No description
4 Replies
MODiX
MODiXβ€’13mo ago
Aaron
REPL Result: Success
false == false == true
false == false == true
Result: bool
True
True
Compile: 387.899ms | Execution: 54.787ms | React with ❌ to remove this embed.
Aaron
Aaronβ€’13mo ago
so no, that doesn't do what you want it's doing (IsUp(s) == IsUp(tmp)) == true if both IsUp's return false, they're equal, which makes the entire thing true
anita
anitaβ€’13mo ago
the correct thing would be
if(IsUp(s) && IsUp(tmp))
if(IsUp(s) && IsUp(tmp))
Accord
Accordβ€’13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server