T
T
Treniki2017-04-07 12:34:27
JavaScript
Treniki, 2017-04-07 12:34:27

Why is JS throwing an "illegal character" error?

Hello. In this expression

if (deg >= 360-45\2 || deg <= 45\2) {
  direction = "north";
};

JS does not compile and writes an error: "illegal character", swearing at the sign after >=.
Where is the mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2017-04-07
@Treniki

if (deg >= 360-45/2 || deg <= 45/2) {
  direction = "north";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question