Just dipping my toes in the JavaScript world and currently navigating through AngularJs on the client side. I've written some code that seems to be working fine, but I'm wondering if there's a way to achieve the same result using Angular's forEach
loop?
ctrl.js
for (var i = 0; i < selectedOwners.length; i++) {
if (selectedOwners[i].workerKey === obj.workerKey) {
selectedOwners.splice(i, 1);
break;
}
}