(no title)
xlayn | 9 years ago
firstVar || (secondVar=='Bob' && thirdVar==41)
seems very clear to me.On the other hand JavaScript has always had logic operators... therefore has always been able to perform logic programming.....
From http://www.ecmascript.org/es4/spec/overview.pdf page 18
“&&=” and ”||=” operators
ES4 introduces assignment operators for the logical
“&&” and “||” operators. These assignment operators
are short-circuiting; if the value of the left-hand-
side determines the value of the result then the right-
handside is not evaluated.
detaro|9 years ago
classical example in the readme: https://github.com/mcsoto/LogicJS#goals
xlayn|9 years ago