We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63265cb commit e6db536Copy full SHA for e6db536
1 file changed
Sprint-1/2-mandatory-errors/3.js
@@ -7,3 +7,16 @@ const last4Digits = cardNumber.slice(-4);
7
// Then run the code and see what error it gives.
8
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
9
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
10
+
11
+PREDICTION:
12
+//the code wont work because the card number isnt in ("") and the computer wont be able to apply the .slice due to this.
13
14
+THE ERROR:
15
+//cardNumber.slice is not a function
16
17
+//YES! the error is what i predicted.
18
19
+FIX:
20
+const cardnumber = "4533787178994213";
21
+const last4Digits = cardnumber.slice(-4);
22
+console.log(last4Digits);
0 commit comments