File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Sprint-1/2-mandatory-errors Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1- const 12 HourClockTime = "20:53" ;
2- const 24 hourClockTime = "08:53" ;
1+ // Original variable names are invalid because variable names cannot start with a number
2+ // const 12HourClockTime = "20:53"; // This will cause a syntax error
3+ // const 24hourClockTime = "08:53"; // Also invalid for the same reason
4+
5+ // Fix:
6+ // Variable names must start with a letter, underscore (_), or dollar sign ($).
7+ // So we rename the variables to valid names below:
8+
9+ const hour12ClockTime = "20:53" ; // Valid variable name for 12-hour clock time
10+ const hour24ClockTime = "08:53" ; // Valid variable name for 24-hour clock time
11+
12+ // Explanation:
13+ // Variable names cannot begin with a number in JavaScript,
14+ // so prefixing them with a letter or underscore solves the problem.
You can’t perform that action at this time.
0 commit comments