Skip to content

Commit e4b6cae

Browse files
committed
explain variable rename in sprint 2 error 4
1 parent e8e9f51 commit e4b6cae

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@ const twelveHourClockTime = "8:53pm";
22
const twentyFourHourClockTime = "20:53";
33

44
console.log(twelveHourClockTime);
5-
console.log(twentyFourHourClockTime);
5+
console.log(twentyFourHourClockTime);
6+
7+
// Original code used `12HourClockTime` and `24hourClockTime` as variable names.
8+
// but these start with numbers, which JavaScript doesn't allow
9+
// variable names must start with a letter, underscore, or dollar sign.
10+
// So I renamed them to `twelveHourClockTime` and `twentyFourHourClockTime`.
11+
// This avoids the SyntaxError and makes the code run.

0 commit comments

Comments
 (0)