Check multiple array has same values Javascript

I am working on a project I got stuck in a place can anyone help me out.

I'm having 2 variables of array data1=(a,b,c,d,e,...)anddata2=(a,b,c,d,e,...)

if we alert data1[0]=(a,b)

Now I need to check both data1 and data2 values are same. == is not working.

can anyone help?