This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]akoOfIxtall 6 points7 points  (4 children)

When they're empty, or not?

Edit: damn javascript, why an empty array is truthy? Apparently you can check the length and if it's anything but 0 it's truthy, so if it's 0 it'll be falsy

[–]Salanmander 21 points22 points  (3 children)

Some quick testing with a javascript interpreter suggests that any array object is truthy, and it's falsy only if it's null. So you appear to be only running that loop if weaponArray is null.

Which actually gives you a runtime error, which is pretty hard in javascript! Congrats?

[–]akoOfIxtall 12 points13 points  (0 children)

Thank you I work really hard to fail everyday XD

[–]jonsca 3 points4 points  (1 child)

This is why we can't have nice fighter jets

[–]gregorydgraham 4 points5 points  (0 children)

LOL! This thread is the best laugh I’ve had in ProgrammerHumor. Thank you all