Reputation: 8209
In JavaScript syntax, we know of stuff like:
+
, =
, ,
, (...)
being operatorsvar
, let
, function
, for
being keywords1
, "string"
, being literals1+1
being an expression containing operators and literals
and
var myVar = 1+1;
being a statement containing keywords and expressions
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
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
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