I stumbled upon this for the first time, what does the ~~n mean in JavaScript?
var isSquare = function(n) {
n = Math.sqrt(n);
return n == ~~n;
}
I know that the code checks if n is a "perfect" square.
I stumbled upon this for the first time, what does the ~~n mean in JavaScript?
var isSquare = function(n) {
n = Math.sqrt(n);
return n == ~~n;
}
I know that the code checks if n is a "perfect" square.