I have a function displaySelectedRole() and I have variables $scope.Role and $scope.rolenames .I need to remove all values available in $scope.role from $scope.rolename.
$scope.role= ["A","B","C"];
$scope.rolename =["A","B","C","D","E"]
I need to splice the values and get $scope.rolename = ["D","E"]
$scope.displaySelectedRole = function(role, index) {
debugger;
$scope.role.splice(RoleNames[index]);
console.log($scope.role);
I tried to use splice based on index , but problem is it given empty array values in console.
$scope.rolename.filter(x=>!$scope.role.includes(x))