整形转2进制后里面有多少个1
var input = 10140101;//传入的参数var count = 0;function getCount(ins){ if(ins == 0){ return count; } var ret = ins%2; var shan = Math.floor(ins/2); if(ret == 1){ count++; } return getCount(shan);}var ret = getCount(input);console.log(ret);
?