Skip to content

Commit 64046c5

Browse files
committed
docs: enhance README with information on semicolons and ASI in JavaScript
- Added a callout explaining Automatic Semicolon Insertion (ASI) and the rationale for omitting semicolons in the workshop. - Provided a link to further reading on the topic for interested learners.
1 parent 688406d commit 64046c5

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

exercises/README.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ By the end of this workshop, you'll be able to:
3737

3838
Let's build something solid! 🏗️
3939

40+
<callout-info>
41+
**Semicolons and ASI**: JavaScript has *Automatic Semicolon Insertion (ASI)*,
42+
which means the runtime can insert semicolons when you omit them. In this
43+
workshop, we leave semicolons out because our tooling handles the edge cases
44+
(e.g. formatting and linting), and it's a style preference. It's also easier
45+
to remember the few rules for when you **must** add a semicolon than to remember
46+
all the rules for when you can safely omit them while still using semicolons.
47+
If you're curious about the details and tradeoffs, see
48+
[Semicolons in JavaScript: A preference](https://kentcdodds.com/blog/semicolons-in-javascript-a-preference).
49+
</callout-info>
50+
4051
<callout-info>
4152
**Code comments** are notes you write in your code that explain what it does.
4253
</callout-info>

0 commit comments

Comments
 (0)