function arrHasValue(v, arr) { var output = false; for (var i in arr) { if (v == arr[i]) { output = true; return output; } } output = false; return output; }
var arrs = [‘1‘,‘2‘,‘3‘];
console.log(arrHasValue(1,a)); //true
原文地址:https://www.cnblogs.com/Byme/p/8270822.html
时间: 2024-10-22 12:07:47