Possible Duplicate:
What is the !! (not not) operator in JavaScript?
Can someone explain this ‘double negative’ trick?
Because I'm playing around with the HTML5 video possibilities, I came across getUserMedia.js, which offers cross browser support.
While investigating how the library works (and trying to get it working in a requirejs module), I found the following strange if
construct:
if ( !! navigator.getUserMedia_) {
...
Double negation? What does it mean and why? Why not simple use the following?
if (navigator.getUserMedia_) {
...