I have two javascript array objects. Is there any easiest way to find whether those two array are same or are there any difference.
For example if I have
var oldPositions = [1, 2 ,5 ,7]
var newPositions = [2 ,7]
or
var oldPositions = [2 ,5 ]
var newPositions = [2 ,5, 9]
in both of these example, I should compare the arrays and find the result as not matched. Any suggestion?