Binary representation of a given number | Function to convert decimal to binary number ; Driver code
function bin ( n ) { if ( n > 1 ) bin ( n >> 1 ) ; document . write ( n & 1 ) ; } bin ( 131 ) ; document . write ( " " ) ; bin ( 3 ) ;