javascript add array to array at index
a1.splice(2, 0, ...a2);
javascript add array to array at index
a1.splice(2, 0, ...a2);
sum index of an array javascript
let countBits = function(n) {
let binary = n.toString(2);
let splitar = binary.split("");
return splitar.reduce((a, b) => parseInt(a) + parseInt(b), 0)
};
console.log(countBits(0))
console.log(countBits(4))
console.log(countBits(7))
console.log(countBits(9))
console.log(countBits(10))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us