Skip to content

Commit c8eacf0

Browse files
authored
Update 1.js
1 parent 401518d commit c8eacf0

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// trying to create an age variable and then reassign the value by 1
22

3-
const { cityOfBirth } = require("./2");
3+
44

55
let age = 33;
6+
age = age + 1;
67
console.log(age);
7-
// Currently trying to print the string "I was born in Bolton" but it isn't working...
8-
// what's the error ?
9-
console.log(`I was born in ${cityOfBirth}`);
8+
109

1110
// 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)