```
var hammingDistance = function(x, y) {
let diff = 0;
while (x/2>0 || y/2>0){
if (x%2!=y%2){
diff+=1;
}
x = Math.floor(x/2);
y = Math.floor(y/2);
}
return diff;
};
```