Skip to content

Commit 2f25058

Browse files
committed
Interpret the error message that occurs when a number starts a variable name
1 parent 2deec27 commit 2f25058

File tree

1 file changed

+11
-1
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+11
-1
lines changed

Sprint-1/2-mandatory-errors/4.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
const 12HourClockTime = "20:53";
2-
const 24hourClockTime = "08:53";
2+
const 24hourClockTime = "08:53";
3+
4+
console.log(12HourClockTime , 24hourClockTime);
5+
6+
// Answer
7+
// After running the code, it gave an error message "SyntaxError: Invalid or unexpected token".
8+
// This error means that Javascript was unable to read the code because a variable name cannot start with a number
9+
// I can fix this code by removing the numbers from the start of the variable name
10+
11+
const HourClockTime = "20:53";
12+
const hourClockTime = "08:53";

0 commit comments

Comments
 (0)