Open am-a opened 11 years ago
@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.
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.
What's that before the req?