数组删除
arr.splice(1,1);
是否在数组中
不存在返回-1,存在返回索引
$.inArray(str,array)
数组拼接成字符串
array.join(',')
数组去重复
Array.prototype.distinct = function() {
var x = [], r = [];
for(var i = 0; i < this.length; i++) {
x['_' + this[i]] = this[i];
}
for(var b in x) {
if(typeof x[b] != 'function') {
r.push(x[b]);
}
}
return r;
};
字符串变数字
Number('1')
Comments | NOTHING