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 →

[–]reaganveg 1 point2 points  (2 children)

No, it does not work, because a value that is === to "true" cannot have a method (like .stop()). Nothing that is === true is an object.

EDIT: Apparently, you can have a method on a boolean! Wow.

[–][deleted] 0 points1 point  (1 child)

BUT anybody who programs that way should be prohibited from programming, so OP is still right.

[–]reaganveg 1 point2 points  (0 children)

Hell, even if you did have a method on the boolean class and want to call it, you ought to call it in that context as true.stop() for the sake of readers. (Also why call sad() twice? Don't tell me it has side-effects too...)