What I basically want to achieve is compare both the files by data-key and data-content-type and check to see if the teacher-value has changed in the newCourses.html and then add a class .valueHasChanged to the changed span in the oldCourses.html.
In the above example sciences teacher-value has changed from James to Jimmy. In that case oldCourses.html span containing : data-content-type="sciences" data-key="2" should have the class .valueHasChanged.
test =[ [id:1,subject:math], [id:2,subject:math], [id:1,subject:science], ]
what i basically want is when i am trying to push a new object in my array , i should check if the id subject pair already exits like [id:1,subject:math] should be inserted. So basically unique pairs are only to be allowed. Hwo can i loop through this test array to find if a match exits.