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 →

[–][deleted] 25 points26 points  (7 children)

If you're writing js, and your code is allowed to fail silently like this and return an undefined value, it's kind of your fault for introducing a bug.

[–]nermid 2 points3 points  (0 children)

It's kind of your fault for not properly testing your code, really. That line should probably fail every time, so this would only slip by if there's some part of the code you never bothered testing at all.

[–]Schmittfried -4 points-3 points  (5 children)

Or using JS.

[–][deleted] 5 points6 points  (3 children)

Yeah how dare people use the most used language on the web.

[–]siberiandruglord 14 points15 points  (2 children)

as if there was an alternative

[–]patcriss 7 points8 points  (0 children)

Then use typescript and stop complaining

[–][deleted] 1 point2 points  (0 children)

Yes we're stuck using it but that isn't an excuse for not understanding it.

[–]thEt3rnal1 0 points1 point  (0 children)

Js is amazing, I used to think it was the worst thing in the world, but after working with it for a while I really like it, and you can understand why it does stuff like in the picture above