Comment

Comment by mxben

`alert("hello")` is an expression and also a statement.

  a = alert("hello"); // Assigns a to undefined
What isn't an expression? An `if` statement is not an expression.

  a = if (true) alert("hello"); // Uncaught SyntaxError: Unexpected token 'if'
parent mxben 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton