var test = ['hello', 'Hello']
var arg1 = test[0].split('').sort().join('').toLowerCase(); // ehllo
var arg2 = test[1].split('').sort().join('').toLowerCase(); // hello
Would someone be able to explain why the sort method appears to have no effect on the 2nd element of the test array?
"H" < "e" === truetest[1].toLowerCase().split('').sort().join('');should work. You are sorting then transforming.