js中陣列模式
var myArray=new Array();
myArray = {1,4,3,7,6,9,2,5};
//獲取最大值
var max_val = '';
for (var a = 0; a < myArray.length; a++) {
var cur1 = myArray.get(a);
cur1 > max_val ? max_val = cur1 : null
}
//獲取最小值
var min_val = '';
for (var a = 0; a < myArray.length; a++) {
var cur1 = myArray.get(a);
cur1 > min_val ? min_val = cur1 : null
}