var data =[1,2,3,4,5,]
data = data.substring(0,data.length-n)
//意思就是将最后一位截取掉
上面是错误的,意思是取第0位以及字符串长度-n位的字符串