How to transform a decimal number into a binary type [closed]

-1

Hello How could I transform a decimal number into binary typeScript with the help of recursion?

    
asked by Jefferson Cuello 24.06.2018 в 20:00
source

1 answer

1

One option is to store the value you want to convert in a variable and then call the toString method with a parameter "2". Example

let n = 254;
let j = n.toString(2); 
alert(j);

I hope it serves you. Greetings.

    
answered by 25.06.2018 в 05:21