I am attempting to invert the binary digits of a base-10 value using JavaScript, according to this W3Schools page, JavaScript's Bitwise NOT operator (i.e. ~) should do just that.
In an example they show ~5 resulting in a value of 10, but when I attempt to execute the simple program ...
console.log(~5);
... the RTE logs -6, not 10. What am I doing wrong?