Hacker News new | ask | show | jobs
by dyscrete 4196 days ago
Well it's not just about `this` but the arguments to pass to console rather. In this case:

    n.forEach(console.log.bind(console));
forEach is passing console all of its callback arguments, resulting in logging of keys, values, and array.

EDIT: Forgot array

1 comments

Ah, I understand. It reminds me of how the `cut` function could be used in Scheme.