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 aedf01f commit 09fe0dcCopy full SHA for 09fe0dc
Sprint-1/2-mandatory-errors/3.js
@@ -1,6 +1,10 @@
1
-const cardNumber = 4533787178994213;
+const cardNumber = '4533787178994213';
2
const last4Digits = cardNumber.slice(-4);
3
4
+// A number was not able to be sliced, whereas a string can be sliced
5
+// So, the error is that cardNumber should be a string, not a number
6
+console.log(last4Digits);
7
+
8
// The last4Digits variable should store the last 4 digits of cardNumber
9
// However, the code isn't working
10
// Before running the code, make and explain a prediction about why the code won't work
0 commit comments