Driver program to test above functions
var arr1 = [ 1 , 3 , 4 , 5 ] ; var n1 = arr1 . length ; document . write ( findSmallest ( arr1 , n1 ) + " " ) ; var arr2 = [ 1 , 2 , 6 , 10 , 11 , 15 ] ; var n2 = arr2 . length ; document . write ( findSmallest ( arr2 , n2 ) + " " ) ; var arr3 = [ 1 , 1 , 1 , 1 ] ; var n3 = arr3 . length ; document . write ( findSmallest ( arr3 , n3 ) + " " ) ; var arr4 = [ 1 , 1 , 3 , 4 ] ; var n4 = arr4 . length ; document . write ( findSmallest ( arr4 , n4 ) + " " ) ;