Consider the following code:
`abc`.split(`b`)
`abc`.split(`b`)
This fails with TypeError: "abc".split(...) is not a function
Try it here.
To make it work, we need to insert a semicolon between those two statements. Also the code works fine if we use a regular string on the second line:
`abc`.split(`b`)
"abc".split(`b`)
What is the reason for this behaviour?
I guess it has something to do with the automatic semicolon insertion doing some whacky stuff, but I can't figure out what this would be.
Also the fact that there seems to be a difference between regular and template strings kinda confuses me. Shouldn't those be equivalent?