[Solved] Strange JQuery behavior

After spending hours I finally found the reason :

1: In VS2015 code works as expected

2: In VS2017 statement if (1>5) gets resolved to true!!! (Pay attention to space after if

3: in VS2017 statement if(1>5) works as Expected!

Now I’m convinced this is VS2017 bug.

Reference: mozilla.org
A whitespace character is an empty space (without any visual representation) on screen. Examples of whitespace characters include space characters, tabs, and line break characters. In JavaScript, the use of excessive whitespace is ignored.


Update: to make things worst, statement 2 above behaves intermitently.

solved Strange JQuery behavior