Hacker News new | ask | show | jobs
by Bilal_io 1264 days ago
You can do something similar in JavaScript

> const love = "love"; > { // Section > console.log(`What is ${love}`); > }

1 comments

Not the same ergonomic.

The language doesn't "understand" it's a section (no opportunities listed in the original comment).

Actually, it does, though the only real use is with the `break` keyword for breaking out of a labelled block (or break / continue in a for loop): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Things like stack traces don't track them, unfortunately.