JS实现判断数组是否包含某个元素示例
本文实例讲述了JS实现判断数组是否包含某个元素。分享给大家供大家参考,具体如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> [removed] Array.prototype.S = String.fromCharCode(2); Array.prototype.in_array = function (e) { var r = new RegExp(this.S + e + this.S); return