JS判斷數組中是否包含某個值

Array.prototype.S=String.fromCharCode(2); Array.prototype.in_array=function(e) { var r=new RegExp(this.S+e+this.S); return (r.test(this.S+this.join(this.S)+this.S)); } var arr=["1","2"]; alert
相關文章
相關標籤/搜索