SMRTR ProgrammingMar 12, 2025Hacker News

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
SMRTR Programming

Get the next batch of curated summaries in your inbox.

This archive is built from SMRTR newsletter summaries. Subscribe for hand-picked stories without the extra noise.