-2
我有一行这样的代码如果物品存在于数组中,如何拼接物品?
$scope.selectItem.push(item['id']);
现在我要检查,如果项目[“身份证”]在$ scope.selectItem现有拼接它。
任何想法尊敬
我有一行这样的代码如果物品存在于数组中,如何拼接物品?
$scope.selectItem.push(item['id']);
现在我要检查,如果项目[“身份证”]在$ scope.selectItem现有拼接它。
任何想法尊敬
另一种可能的解决方案:
if ($scope.selectItem.indexOf(item['id']) !== -1) // it exists
我们可以看到一些前/后图片? – georg