Adelin
Adelin

Reputation: 8209

How is a comment categorized in JS?

In JavaScript syntax, we know of stuff like:

How would you group // and /* ... */? I feel like it is an operator, but I don't see it in the Operator precedence table

I will soon give a training for beginners in JavaScript and I would like to be as rigorous as I can

Upvotes: 3

Views: 72

Answers (2)

Mikhail Litvinov
Mikhail Litvinov

Reputation: 452

Comment symbols, just as ;,,,{ and others, are lexical primitives and considered to occupy a high-level category, which is simply called Comments.

Upvotes: 1

T.J. Crowder
T.J. Crowder

Reputation: 1074495

Comments are their own category, and a very high-level syntax production. You can see this in the lexical structure overview in the specification, and in the section on comments.

Upvotes: 4

Related Questions