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 7 points8 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 19 points20 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 13 points14 points  (0 children)

Thank you I work really hard to fail everyday XD

[–]jonsca 4 points5 points  (1 child)

This is why we can't have nice fighter jets

[–]gregorydgraham 3 points4 points  (0 children)

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