Coder100
Coder100

Reputation: 305

Javascript optional 0: .75 vs 0.75

I have a piece of code that is the following:

let vector = new Vector2(mouseX / .75, mouseY / .75)

and this works perfectly. However, in VScode, the syntax highlighting becomes weird: syntax highlighting assuming it is a regex

Almost as if the editor is thinking it is becoming a RegExp pattern.

So, the question is, is .75 an intended feature equivalent to 0.75 or not?

Thanks in advance!

EDIT: The two are the same thing, it is just a syntax error on VScode's part.

Upvotes: 0

Views: 102

Answers (1)

anbcodes
anbcodes

Reputation: 849

According to MDN they are equivalent. It is probably just a syntax highlighting error.

Upvotes: 2

Related Questions