// 假设a是你要操作的数组var result = 1;for ( index = 0, len = a.length; index < len; ++index) { result *= a[index];}