Find the minimum difference Iterate and find which adjacent elements have the minimum difference
for ( let i = 1 ; i < a . length ; i ++ ) { mindifference = Math . min ( mindifference , a [ i ] - a [ i - 1 ] ) ; }