Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of minor typos #10

Open
am-a opened this issue Mar 22, 2013 · 1 comment
Open

Couple of minor typos #10

am-a opened this issue Mar 22, 2013 · 1 comment

Comments

@am-a
Copy link

am-a commented Mar 22, 2013

Hopefully highlighted in bold...

What problem does it solve?

This plugin model translates well between the browser and the server because developers can write different plugins to suite > suit the needs of the different environments.

function middleware1(req, res) {
  if(~req.url.indexOf('foo')) {
    return false;
  }
}

What's that before the req?

@AndreArtus
Copy link

@am-a, are you referring to the tilde (~) in if(~req.url.indexOf('foo'))? If so that is the JavaScript equivalent of bitwise not, or [one's] complement. It is in essence a shortened version of if(req.url.indexOf('foo') > -1) or if(~req.url.indexOf('foo') >= 0).

While it is in broad use it has its detractors, and I include myself among them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants