and / or do not return boolean values as in java, etc. Instead they return one of the values under comparison. With this we can do tricks like a? b: c (java, c, etc)
a and b - returns b, the last true element, if both are true, otherwise a.
a or b - returns a, the first true element. if none are true, returns b.
if using a and b or c, a must always be true if we wish to make a choice between b or c.
{Notes to self, programming, technology, linux, windows, git} U {Papers, reviews, games, coffee, tabletennis, ramblings} = {things worth saving}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment