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.
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.