How am I defining this as a function..?

Like literally…

How am I defining this as a function?
I am literally defining ms as a variable, and I get the error “TypeError: ms is not a function”
This is what I was talking about in this thread.
It’s just strange, since there things shouldn’t even really give a error.

Hi @Aprixia I believe you are running afoul of the difficult-to-interpret JavaScript automatic semicolon insertion rules. Because the first character on the line with the final async statement can be interpreted as the beginning of a function call, the JavaScript engine doesn’t automatically insert a semicolon after the preceding line. You can read about this in (for ES5) - the last example in that section closely follows what you’re doing.

I find these rules hard to remember, so I always use semicolons even though that marks me as pretty old school.

If you add a semicolon to your line ending with ms I think things will work as you expect them to.

Time to just spam a lot of semicolons then,
1 per line of code without a continue on the next line.
.then and functions and more stuff like that.

Hahah, sorry for this, but I kinda felt I had to:

“I use semicolons because I won’t let a dumb box deicide where to put them…” — Me on JS semicolons about 3 years ago.