187
Views
3
Comments
Solved
IF syntax in javascript
Question

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

2018-09-06 22-01-31
Viraj Kataria
Solution

Hi Hentry,

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

// Your Code Here...

}

Hope this helps!
Thanks

2021-04-09 11-42-43
assif_tiger
 
MVP

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


UserImage.jpg
Hentry -

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

Anyway thank you so much Viraj!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.