-2

i have one line code like this

$scope.selectItem.push(item['id']);

now i want check if item['id'] existing in $scope.selectItem splice it.

any idea Honorable

Alireza Davoodi
  • 749
  • 7
  • 20

1 Answers1

1

Another possible solution:

if ($scope.selectItem.indexOf(item['id']) !== -1) // it exists
Wottensprels
  • 3,307
  • 2
  • 29
  • 38