javascript - How to compare the order of two sets of data -
i have got 2 sets of data .
var array = ["one" , "two" , "three" , "four" , "five"]; var t1 = "one" ; var t2 = "two" ; var t3 = "three" ; var t4 = "four" ; var t5 = "five" ;
i want check order of data in both sets , trying way
if(t1==array[0] && t2==array[1] && t3 ==array[2] && t4==array[3] && t5==array[4]) { alert('yes'); } else { alert('no'); }
but i'm getting alert "no".
could please let me know how resolve ??
Comments
Post a Comment