I have 2 arrays that I need to compare against each other and retun the count of the same:
ex: array1[abcd] array2 [adce] return would be 2 as both a and c are in same postion.
I would then have to return 2,1 as a and c are in the same place but d is in the array but in the wrong place.
var index = 0;
for(index = 0; index < length; index++){
if(array1[index] == array2[index]){
count++
}
return count
}
which i ofcourse is only returning 1, so not sure where to go from here?