updated file by JS standard

This commit is contained in:
Vivek Patel
2020-10-01 13:29:41 +05:30
parent ca1f5385da
commit 89f5def29a

View File

@ -7,14 +7,11 @@
*/
function binary_count_setbits(a) {
"use strict"
// convert number into binary representation
let binA = a.toString(2)
// return number of set bits in binary representaion
return binA.split("1").length - 1
function BinaryCountSetBits (a) {
'use strict'
// convert number into binary representation and return number of set bits in binary representaion
return a.toString(2).split('1').length - 1
}
// Run `binary_and` Function to find the binary and operation
console.log(binary_count_setbits(251))
console.log(BinaryCountSetBits(251))