Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的一行代码
$scope.selectItem.push(item['id']);
现在我想检查$scope.selectItem 中是否存在item['id']拼接它。
任何想法 光荣的
另一种可能的解决方案:
if ($scope.selectItem.indexOf(item['id']) !== -1) // it exists