SOURCE

var bitwiseComplement = function(N) {
  const a = N.toString(2);
  const arr = new Array(a.length).fill(1).join('');
  const cha = arr - a;
  const len = arr.length - (''+cha).length;
  const chr = new Array(len).fill('0').join('');
  const er = parseInt(chr + (arr - a) , 2);
  console.log(chr)
  console.log(arr)
  console.log(a)
  console.log(chr + (arr - a))
  return er
};

bitwiseComplement(67185);
console 命令行工具 X clear

                    
>
console