Clean JS Solution
Code
![image.png](https://assets.leetcode.com/users/images/c357a9a5-bfd3-41b1-8b13-0ad72bfc75c0_1741481358.495316.png)


# Code
```javascript []
/**
 * @param {number} dec
 * @return {string}
 */
var baseNeg2 = function(dec) {
    if (dec === 0) return "0";
    
    let result = "";
    
    while (dec !== 0) {
        const remainder = ((dec % 2) + 2) % 2;
        result = remainder + result;
        dec = Math.floor((dec - remainder) / -2);
    }
    
    return result;
};
```
['Math', 'JavaScript']