Re:Currying in JavaScript
by tikamasala on Monday July 20, 2015 @07:33AM
(#9915275)
I use
var cl = console.log.bind(console);
A lot
Is this wrong?
[ Parent
| on HN ]
In this particular case, performance doesn't really matter that much (IMHO) and I don't see there being 'this' confusion as you don't actually use 'this', so I would continue using your current code. That said, if you did want to avoid .bind(), you could do something like
var cl = function () { console.log.apply(console, arguments); };