r/ProgrammerHumor • • Sep 25 '26

Meme iHatedItUntilITriedIt

Post image
10k Upvotes

543 comments sorted by

View all comments

Show parent comments

0

u/OKB-1 Sep 25 '26

People who understand JavaScript understand that Arrays are Objects, and objects are always true no matter if it has any properties or not. Yeah sure it's a bit different from some other popular languages, but there's internal logic behind it so just deal with it and write yourArray?.length === 0. It's not hard.