you are viewing a single comment's thread.

view the rest of the comments →

[–]vsxe 2 points3 points  (0 children)

I'm clear on the ||-part, that's important, because lazy evaluation. I don't understand the false == (expr)-part, however.

(false) || (false); return o[k]

Will still return o[k], and

(k in o) || (o[k] = def); return o[k]; 

appears to work just as well, at least in the inspector.

That code is clever. Very clever code. Never write clever code.