HACKERRANK day 9 js question solution

The question

implement a calculator that uses binary numbers.
Entire question -> Question