I have been unable to find any reference to this statement in any book, manual, or site. As far as I can tell, it functions exactly as a //
comment. For example:
console.log("1");
--> console.log("2");
console.log("3");
will print
1
3
What I'm curious about is exactly what the difference between -->
and //
is, if any exists, and also why -->
seems to completely absent from all the JavaScript references I've seen - the only reason I found out about it at all was because I accidentally typed it into Adobe Dreamweaver, and it was highlighted as a comment. Thanks!
Edit: Here is a functional jsFiddle demonstrating the behavior.
Edit 2: I've tested further, and I've discovered a few things.
- This only works if there are exactly two dashes.
->
and--->
will throw errors. - This only works with a "greater than" symbol.
--<
will throw an error. - This will not work in the middle of or at the end of a line.
console.log("1"); --> console.log("2");
will throw an error.