if (options.indexOf(7)!=-1) { do… } indexOf是字符串方法,自己写的是数字,自然不支持,不报错才奇怪呢。 options.indexOf(‘7’) 文章导航 js 判断元素是否存在 js in_array