I just really cant grasp the meaning of the statement . Could anyone explain more : “First, use the remainder operator (% ) to set binary equal to the remainder of input divided by 2 .”
Your code so far
const decimalToBinary = (input) => {
let binary = "";
while (input > 0) {
// User Editable Region
binary %= input / 2
// User Editable Region
### Challenge Information:
Learn Recursion by Building a Decimal to Binary Converter - Step 40
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-recursion-by-building-a-decimal-to-binary-converter/step-40
First, use the remainder operator (%) to set binary equal to the remainder of input divided by 2.
When you use the % operator the computer is dividing the first operand by the second term and it throws away the result of the division. It does however return as result if there was a remainder left from divining and how much it was.
So, it is asking to use this operator with the value in input and the integer 2 and the result to be assigned back to the variable binary
Notice that there is no division that you need to tell it to perform.