Single or double equals (or no equals) for boolean criteria
Hi,
A fairly basic question but it would be great to have a definitive answer and I can't find one anywhere.
What is the correct format for boolean criteria for a conditional expression (like an if, or to select form data)?
And does it matter which format you use? (Because it doesn't
seem to make any difference when I test out the different versions).
A. One equals, e.g.
- FormData = Form[bool = true]
or e.g.
- if (bool = true) {<expression>;}
B. Two equals, e.g.
- FormData = Form[bool == false]
or e.g.
- if (bool == true) {<expression>;}
C. No equals, e.g. (I assume this only works for 'if true')
- FormData = [bool]
or e.g.
- if (bool) {<expression>;}
Much appreciated,
Katherine