Re:I still love PHP and JavaScript
by sjamaan on Wednesday August 03, 2022 @04:55AM
(#32329276)
Does that only cull nulls, or also zeroes, falses and empty strings?
[ Parent
| on HN ]
Anything "falsy" -- any item that, when cast to boolean results in false. So, also zeroes, falses and empty strings.
That was my point - OP said it "culls nulls", and the pitfall is that kind of thinking - if you think of it as removing nulls and you're not mindful, you might be deleting things from the list you don't want to be deleting.