babokd
April 3, 2018, 2:50am
1
I think perhaps there is a small logic issue in the suggested solutions - it doesn’t properly check boolean properties
E.g. when onBoat == false, I think this should be truthy
However, each solution basically considers any valid boolean value of ‘false’ to be not truthy.
babokd
April 3, 2018, 2:55am
3
For example:
truthCheck([{“name”: “Pete”, “onBoat”: false}, {“name”: “Repeat”, “onBoat”: false}, {“name”: “FastFoward”, “onBoat”: false}], “onBoat”)
I would expect this to return TRUE, but because onBoat is assigned the value of FALSE, it returns False. I hope I’m being clear!
babokd
April 3, 2018, 3:02am
5
Got it - I took truthy to mean that the object both has the property, and the value is valid (different from the value being false). Guess I just didn’t quite understand what the criteria for “truthy” is!
babokd
April 3, 2018, 3:07am
7
Goldfish memory here! Thanks, Randell! You rock!