In this case when n is a number parameter in the function.
Why is toString(2)
going to n % 2
and return the divisor remainder?
I thought that toString just return a number into a string.
+n.toString(2)
function toBinary(n) {
var toBinary2 = +n.toString(2)
return toBinary2
}
console.log(toBinary(2))