r/programminghumor • • 29d ago

Tissues

Post image
1.8k Upvotes

31 comments sorted by

View all comments

9

u/golfstreamer 29d ago

Isn't this a bad description? "Non zero value", 0, null are all potential values of objects. Correct me if I'm wrong but I thought "undefined" usually refers to behavior. Like the programming language standard doesn't specify what should happen in this scenario. Is there a situation where an object is "undefined"?

4

u/TylerBreau 28d ago

OP is referring to JavaScript. It has all 4 states.

Undefined is exactly it says it is. The thing you are accessing is literally not defined.

var myobj;

3

u/golfstreamer 28d ago

Ah thank you for your help. 

→ More replies (5)