Skip to content

Commit e054a32

Browse files
committed
Predict that the code will fail because .slice() is not valid on a number
1 parent 095d155 commit e054a32

File tree

1 file changed

+5
-0
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+5
-0
lines changed

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

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

3+
const { cityOfBirth } = require("./2");
4+
35
let age = 33;
46
age = age + 1;
57
console.log(age);
8+
// Currently trying to print the string "I was born in Bolton" but it isn't working...
9+
// what's the error ?
10+
console.log(`I was born in ${cityOfBirth}`);
611

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