Skip to content

Commit 3430d65

Browse files
committed
Sprint 1 errors: explain 4.js identifier syntax error
1 parent 4582d80 commit 3430d65

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sprint-1/2-mandatory-errors/answers.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,10 @@
4040
## 4.js
4141
- Error shown:
4242
- Why it happens:
43-
- MDN link (optional):
43+
- MDN link (optional):
44+
### 4.js
45+
46+
- Error shown: `SyntaxError: Invalid or unexpected token`
47+
- Why it happens: The variable name `12HourClockTime` starts with a number. JavaScript identifiers cannot begin with a digit, so the parser throws a syntax error.
48+
- Concept: Variable naming rules (identifiers must start with a letter, `_`, or `$`)
49+
- MDN link: https://developer.mozilla.org/en-US/docs/Glossary/Identifier

0 commit comments

Comments
 (0)