As said by roflmao456, if you use the EQUAL (
=) operator that will return always true as you are going to assign a value to the var.
For comparing 2 vars you should use the IS_EQUAL operator (
==).
code:
var foo = true; //Declare a variable statement
if(foo == true){ //or simply if(foo)...
//Your code
}
quote:
I already have var in front.
That doesn't matter.