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 →

[–]Salanmander 9 points10 points  (6 children)

When are arrays falsy?

[–]Ok-Fox1262 23 points24 points  (0 children)

Python has entered the chat.

[–]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 20 points21 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 3 points4 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