See ECMA-262 Annex B.1.1 HTML-like Comments and MDN's JavaScript Reference of Deprecated Features.
In a nutshell, <!-- behaves the same as // (single-line) comments.
--> behaves the same, but only at the start of a line (only allowing whitespaces and comments before).