标签:
var str="1,2,1,2,31,2";
var arr = str.split(",");
for (var i = 0; i < arr.length; i++) {
arr[i] = parseInt(arr[i])+1;
}
console.log(arr);
$.map( arr, function(n){
return n + 4;
});
[2, 3, 2, 3, 32, 3]
[6, 7, 6, 7, 36, 7]
标签:
原文地址:http://www.cnblogs.com/cxxjohnson/p/4824767.html