This solution isn't the fastest one,but it's the most intuitive one I think. HaHa

```
/**
* @param {number} x
* @param {number} y
* @return {number}
*/
var hammingDistance = function(x, y) {
let sum = 0;
while(x||y){
if(x%2!=y%2){
sum++;
}
x = (x - x % 2) / 2;
y = (y - y % 2) / 2;
}
return sum;
};
```