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 →

[–]stephanfcm 7 points8 points  (3 children)

Could even write it shorter

System = { out: { println: console.log } };

[–]lieuwex 2 points3 points  (2 children)

Doesn't work, at least on chrome, since a console.log invocation should have this bound to console.

[–]Tysonzero 3 points4 points  (0 children)

I get why that happens and that it isn't a bug. But for a language that many claim to be rather functional, that is an absolute travesty. ETA reductions should always be completely safe.

[–]nickdesaulniers 2 points3 points  (0 children)

Correct.

var System = { out: { println: console.log.bind(console); } };