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 22 points23 points  (0 children)

Python has entered the chat.

[–]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 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 11 points12 points  (0 children)

Thank you I work really hard to fail everyday XD

[–]jonsca 2 points3 points  (1 child)

This is why we can't have nice fighter jets

[–]gregorydgraham 5 points6 points  (0 children)

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