diff options
| author | SmuSmu <SmuSmu@users.noreply.github.com> | 2018-10-29 10:38:48 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-29 10:38:48 +0100 | 
| commit | 1372607b2ae40edf54fe4d04e3dfd3b789016c8e (patch) | |
| tree | 95d30e2ae24ffaf6acb66f671b20e6b75713f0c3 /lua.html.markdown | |
| parent | 3a41a6006ff421b45ae46a521b900216ac28daf7 (diff) | |
| parent | 9317733e2388ccafeea9c331443fe5f42b611390 (diff) | |
Merge pull request #1 from adambard/master
ff
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  | 
