Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

binary conversion recursion in javascript

const decToBi = num => num === 0 ? 0 : num % 2 + 10 * decToBi(Math.floor(num / 2));
console.log(decToBi(10)); //1010
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #binary #conversion #recursion #javascript
ADD COMMENT
Topic
Name
2+3 =