Defining dynamic comments on the fly

The ability to add comments to a template literal should be seen as an extra nice-to-have feature, not a "JavaScript is broken and must be fixed" thing.

We see the same thing from different aspect. Imagine:

  • a bus without grips/handles,
  • a train, airplane without toilets, and
  • a long highway without rest/parking areas

All of them fulfills their purpose of construction in an excellent constructive way, ie to help people move from one place to another. Now, imagine that one needs to evacuate his/herself. One, after being finally evacuated on his/herself, starts complaining and blaming the maker. One of the maker's company contends that the construction is quite consistent and predictable with its purpose. The ability to add toilets to the construction should be seen as an extra nice-to-have feature, not a "Construction defect/lack and must be fixed" thing. Very nice!

So, for example, we could make ${* be a comment-start, and *} be a comment end.

It is obvious, that any solution has to work as per code chunk and not as per expression to help de-activating/isolating many expressions at the same time. It should also be combined with HTML comments without problem.

Or, if we accept that JavaScript is not broken in its current state (along with every other language with multi-line strings), then we could also discuss adding smarts to editors, so that they can do the ${''/* ... */} workaround.

Editor's smarts is not a solution; it's just a "throw the ball to someone else" workaround, like maker's asking subcontractor to install bigger windows and advising you to take your b@ttocks out of them and evacuate yourself!

Please transfer your comments to

since there is nothing related to dynamic comments definition.