← Back to challenges

Binary Addition + 0 1 0 1

JavaScriptHardalgorithmsbit_operationsnumbers

Instructions

Create a function that takes two numbers and returns their sum as a binary string.

Examples

addBinary(1, 1) ➞ "10"

addBinary(1, 2) ➞ "11"

addBinary(4, 5) ➞ "1001"

Notes

  • Remember to return the converted result as a string.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Radians to Degrees