Say, I have some code which looks like follows:-
objects1.forEach(function check(o1) {
if (o1.name === object.name) {
object.name = object.name + objectType;
}
});
objects2.forEach(function ifNameMatch(o2) {
if (o2.name === object.name) {
object.name = object.name + objectType;
}
});
Is there any way I could replace this 2 forEach by one or write it in the more better way?
Any suggestion that you could give would be appreciated.