Skip to content

Commit c5ba16a

Browse files
committed
removing the starting digit that caused error from the variable name
1 parent 0821e2b commit c5ba16a

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
const 12HourClockTime = "8:53pm";
2-
const 24hourClockTime = "20:53";
1+
//const 12HourClockTime = "8:53pm";
2+
//const 24hourClockTime = "20:53";
3+
4+
const HourClockTime12 = "8:53pm";
5+
const hourClockTime24 = "20:53";
6+
7+
console.log(HourClockTime12);
8+
console.log(hourClockTime24);
9+
10+
// when we tried to run the code it threw an error saying "SyntaxError: Invalid or unexpected token"
11+
// this happened because when we were declaring a variable we gave an invalid name to the identifier which started with number
12+
// variable name must start with letters or _ or $
13+
// we can fix it buy removing the front number of the identifiers and may be put them last

0 commit comments

Comments
 (0)