split actually returns an array, but since you are not assigning this returned value to anything, nothing happens and then when the next line is executed, you get an error, because str is not an array (it is still a string).
Every method returns a result. When you chain methods, the returned result is passed on to the next method in the chain until the last result is return by the return command.
str.split(""); returns an array but is not assigned anywhere and immediately garbage collected.
var str = str.split(""); here the return value( in this case an array) of the split method is assigned to the str variable.
I recommend opening the console in the browser and trying for example “hello”.split(""); In the console you can see what the split method returns in the console without being assigned to a variable. Also create a function with a bunch of methods inside the function without assigning or returning them to see what happens.