Driver Code
let array = [ 10 , 4 , 5 , 8 , 6 , 11 , 26 ] ; let arraycopy = [ 10 , 4 , 5 , 8 , 6 , 11 , 26 ] ; let kPosition = 3 ; let length = array . length ; if ( kPosition > length ) { document . write ( " " ) ; } else { document . write ( " " + kthSmallest ( arraycopy , 0 , length - 1 , kPosition ) + " " ) ; }