Boolean values: Difference between revisions

CoffeeScript
(→‎{{header|Go}}: added note on template if)
(CoffeeScript)
Line 164:
 
Scripts that want <code>if(TRUE)</code> should require CMake 2.8; do refer to [http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012 cmake --help-policy CMP0012].
 
=={{header|CoffeeScript}}==
CoffeeScript is largely based on JavaScript, but that may only serve to confuse you. Your best bet is to learn all the cases:
 
<lang coffeescript>
h1 = {foo: "bar"}
h2 = {foo: "bar"}
 
true_expressions = [
true
1
h1? # because h1 is defined above
not false
!false
[]
{}
1 + 1 == 2
1 == 1 # simple value equality
true or false
]
 
false_expressions = [
false
not true
undeclared_variable?
0
''
null
undefined
h1 == h2 # despite having same key/values
1 == "1" # different types
false and true
]
</lang>
 
 
=={{header|Common Lisp}}==
Anonymous user