Skip to content

Commit dd6fc22

Browse files
committed
fix(sprint-1): resolve TypeError by checking array bounds before accessing properties
1 parent 6011f82 commit dd6fc22

File tree

1 file changed

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

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
const 12HourClockTime = "20:53";
2-
const 24hourClockTime = "08:53";
1+
// const 12HourClockTime = "20:53";
2+
// const 24hourClockTime = "08:53";
3+
4+
// SyntaxError: Invalid or unexpected token - variable names cannot start with a digit
5+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#variables
6+
7+
// Solution:
8+
const twelveHourClockTime = "20:53";
9+
const twentyFourHourClockTime = "08:53";

0 commit comments

Comments
 (0)