/..

Dark Mode

Enable Console

The Function

addBinary()
addBinary(a,b)

/*
  Adds two numbers together and returns their sum in binary. 
*/

addBinary(10,15); 
// 11001

addBinary(127, 564); 
// 1010110011

Solution by - Need4Swede

How it works

function addBinary(a,b) {
  if(a+b >= 0) {
        return (a+b).toString(2);
    }
    else {
        return (~a+b).toString(2);
    }
}

Try it yourself - Codewars Source

You can also use my built-in JavaScript console