Position of rightmost set bit | JavaScript program for Position of rightmost set bit ; Driver code
function getFirstSetBitPos ( n ) { return Math . log2 ( n & - n ) + 1 ; } let g ; let n = 12 ; document . write ( getFirstSetBitPos ( n ) ) ;