diff options
author | Divay Prakash <divayprakash@users.noreply.github.com> | 2018-10-24 11:30:23 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 11:30:23 +0530 |
commit | adfd3064e52e769dc46f62d8302be7e28be4e48d (patch) | |
tree | 204d82adc9f82ae4fe377b631a1406b97eb6b11d /lua.html.markdown | |
parent | 92022da0a6ea9417521563de9e537f337c426465 (diff) | |
parent | 8f5a67190705c9a3101653901d8f8a7b48eb1775 (diff) |
Merge branch 'master' into MarkdownFRChanges
Diffstat (limited to 'lua.html.markdown')
-rw-r--r-- | lua.html.markdown | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lua.html.markdown b/lua.html.markdown index 1e2d4366..32174a81 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -62,6 +62,11 @@ if not aBoolValue then print('twas false') end -- in C/js: ans = aBoolValue and 'yes' or 'no' --> 'no' +-- BEWARE: this only acts as a ternary if the value returned when the condition +-- evaluates to true is not `false` or Nil +iAmNotFalse = (not aBoolValue) and false or true --> true +iAmAlsoNotFalse = (not aBoolValue) and true or false --> true + karlSum = 0 for i = 1, 100 do -- The range includes both ends. karlSum = karlSum + i |