(a, b)
| 4 | * @return {string} |
| 5 | */ |
| 6 | var addBinary = function (a, b) { |
| 7 | // we used BigInt() to convert binary to Integer. Syntax is BigInt(0b11) here `0b` is prefix and `11` is binary number |
| 8 | let sum = BigInt(`0b${a}`) + BigInt(`0b${b}`); |
| 9 | // sum is converted back to string using toString(2), here 2 is radix argument, so toString(2) converts to binary |
| 10 | return sum.toString(2); |
| 11 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected