Skip to content

Commit 5df9b40

Browse files
authored
Update 1.js
1 parent c8eacf0 commit 5df9b40

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44

55
let age = 33;
6-
age = age + 1;
7-
console.log(age);
6+
7+
age++; // Increases age by 1
8+
89

910

1011
// Changed const to let because the variables value need to change during the program. const creates a fixed reference that cannot be reassigned. but let allows updating the variable which is required when incrementing or modifying values.

0 commit comments

Comments
 (0)