News for hackers. Stuff that matters.
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?
Re:I still love PHP and JavaScript by sergiosgc on Wednesday August 03, 2022 @06:39AM (#32329924)
Anything "falsy" -- any item that, when cast to boolean results in false. So, also zeroes, falses and empty strings.
Re:I still love PHP and JavaScript by sjamaan on Thursday August 04, 2022 @07:31AM (#32341574)
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.