Check whether K | Javascript program to check if k - th bit of a given number is set or not . ; Driver code
function isKthBitSet ( n , k ) { if ( ( n & ( 1 << ( k - 1 ) ) ) > 0 ) document . write ( " " ) ; else document . write ( " " ) ; } let n = 5 , k = 1 ; isKthBitSet ( n , k ) ;