Skip to content

Static console functions / binding #3

Closed
@terinjokes

Description

@terinjokes

Right now assigning a console function to a local variable kind of sucks, since they're expected to be called within the context of console. This requires the developer to bind.

var log = console.log.bind(console);
log('\(゜ロ\)ココハドコ? (/ロ゜)/アタシハダアレ?');

Except this doesn't work in some versions of IE because the console functions aren't instances of Function!

var log = Function.prototype.bind.call(console.log, console);
log('(ノಠ益ಠ)ノ彡┻━┻');

Which is a lot to type for a pretty simple and common task.

var log = console.log;
log('\(◎o◎)/!');

It makes sense to me that this is soemthing worth supporting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions