Hello,

I want to use an IF selection in javascript. But it seems I can't set the condition with 'and' or 'or'. The error message of this problem can be seen below.

I've tried it with if(1 == 1 and 2 == 2) and yet this error still exists. Is the 'if' syntax not the same in outsystems? or I am missing something? Thank you so much

Solution

Hi Hentry,

Try this!
if( (x.top<foodY+11)  && (x.top>foodY-11) ){

// Your Code Here...

}

Hope this helps!
Thanks

Solution

Oh my God, it looks like I am using OutSystems too much ahahaha. 

Anyway thank you so much Viraj!

Viraj Kataria wrote:

Hi Hentry,

Try this!
if( (x.top<foodY+11)  && (x.top>foodY-11) ){

// Your Code Here...

}

Hope this helps!
Thanks

Awesome Observation Viraj Kataria,

Cheers