Skip to content

_([16,17,18]).indexOf oddity in Chrome on Ubuntu #14

@JogoShugh

Description

@JogoShugh

I'm not sure why there is an _ in this line:

https://github.com/openexchangerates/javascript-sandbox-console/blob/master/src/sandbox-console.js#L286

if ( _([16,17,18]).indexOf(e.which, true) > -1 ) this.ctrl = true;

I was having trouble in Chrome under Ubuntu until I removed the _. It kept setting this.ctrl to true.

All that underscore's _ function does is this:

var _ = function(obj) {
    if (obj instanceof _) return obj;
    if (!(this instanceof _)) return new _(obj);
    this._wrapped = obj;
  };

But, I don't understand what is beneficial about doing that for this line?

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