A Perplexing JavaScript Parsing Puzzle
SMRTR summary
JavaScript allows --> at the start of a line to begin a comment, a legacy hack from early web browsers. This quirk remains in modern browsers for backwards compatibility. The code example prints 1, as the comment is ignored and only the last expression is evaluated.
SMRTR provides this summary for quick context. The original article belongs to Hacker News.
Read the original article