Unique program which finds the smallest value from an Array in JavaScript