This question already has answers here:
http://stackoverflow.com//questions/9549780/what-does-this-symbol-mean-in-javascript”>What does this symbol mean in JavaScript? (1 answer)
http://stackoverflow.com//questions/784929/what-is-the-not-not-operator-in-javascript”>What is the !! (not not) operator in JavaScript? (36 answers)
Closed 6 hours ago.
Can someone point me in the way towards some documentation as to what it means to use !!. I have a return statement
return !! _.reduce(collection, function(a, b){
// a is a result of last call
// b is result of calling iterator on current value
console.log("a: "+a)
console.log("b: "+b)
console.log(iterator(b));
//will return false or true based on test
return a && iterator(b);
}, true)
}
which works but this doesn't
return _.reduce(collection, function(a, b){
// a is a result of last call
// b is result of calling iterator on current value
console.log("a: "+a)
console.log("b: "+b)
console.log(iterator(b));
//will return false or true based on test
return a && iterator(b);
}, true)
}
Please login or Register to submit your answer