How to Find Min and Max Value in Array in Javascript