Why does “return str” come before these other commands? Doesnt the function stop running after return is reached making it return the original str inputed? Also why are there no “;” in between the commands?
function reverseString(str) {
return str
.split("")
.reverse()
.join("");
}
Thanks.
Andrej