OK, this one took me a second.
Just as basic error checking, you should learn how to use console.log to check to make sure what you think is happening is really happening. It will save you a lot of headaches.
The problem is in your line var newStrRev=newStr.reverse();
Array.reverse() not only returns the changed array, it also reverses the original,. So your function is comparing two reversed arrays, the same reversed arrays, so it will always return true.
Yes, it’s a little confusing - some functions return the changed data without affecting the original, some change the original.
So you have to copy the first array to the second, and then reverse that. But be careful, copying arrays isn’t as simple as arr2 = arr1; - because they are objects, they are referenced by address and that is basically saying that arr2 wants to point to the same data structure that arr1 does. So to copy arrays, you need something like *arr1 = arr2.split();
And to make your code a little faster, you don’t need to check the whole array. Once you’ve confirmed that the front half of one is equal to the front half of the other, then you don’t need to check the back halves since they are just reversed copies of the front halves of the other.