array.contains(obj) in JavaScript - Stack Overflow

array.contains(obj) in JavaScript - Stack Overflow

瀏覽:707
日期:2026-04-25
What is the most concise and efficient way to find out if a JavaScript array contains an obj? This is the only way I know to do it: function contains(a, obj) { for (var i = 0; i < a ......看更多