

②Math.ceil(向上取整,有小数就整数部分加1) 
语法:Math.ceil(5/2) 输出3 
③Math.round(四舍五入) 
语法:Math.round(5/2) 输出3 
④Math.floor(向下取整) 
Math.floor(5/2) 输出2 
【字符串分割】 
方法一:分割字符串:string.substring(begin,end) 从begin开始到end,不算begin 
实例: 
substring=ITEM000003-2; 
for(var i=0;i<inputs.length;i++){ 
 if(inputs[i].length==10){ 
 items_1.push(inputs[i]); 
 }else{ 
 for(var j=0;j<inputs[i].substring(11,12);j++){ 
 items_1.push(inputs[i].substring(0,10));--->从0到10,不算0 
 } 
 } 
 } 
方法二:split() 方法将字符串分割为字符串数组,并返回此数组 
stringObject.split(separator,limit) 
注意:如果把空字符串 ("") 用作 separator,那么 stringObject 中的每个字符之间都会被分割 
实例:var ch ='i,like,eat-chicken' ; 
console.log(ch.split(',')) 
