Skip to content

Commit 55fa5e7

Browse files
predict and explain the error in the code, and update the expression to get the correct value
1 parent 936de83 commit 55fa5e7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • Sprint-2/2-mandatory-errors

‎Sprint-2/2-mandatory-errors/3.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// The last4Digits variable should store the last 4 digits of cardNumber
22
// However, the code isn't working
3+
// Before running the code, make and explain a prediction about why the code won't work
34

45
//Prediction: The code won't work because cardNumber is stored as a Number and not a string, this is because '.slice()' is a string method
5-
6-
// Before running the code, make and explain a prediction about why the code won't work
76
// Numbers in JavaScript don't work with '.slice()'
87

98

0 commit comments

Comments
 (0)