This appears as a very basic question, but couldn't find any explanations on SO.
Consider this:
var arr = [1, 2, 3];
var str = "123";
function compare(){
return arr.join('').split('') === str.split('')
}
console.log(compare());
console.log(arr.join('').split(''))
console.log(str.split(''))
Cant understand why console logs false
...?