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 4c474e3 commit 4a41676Copy full SHA for 4a41676
Sprint-1/2-mandatory-errors/3.js
@@ -1,6 +1,10 @@
1
-const cardNumber = 4533787178994213;
2
-const last4Digits = String(cardNumber).slice(-4);
3
-console.log(last4Digits); //"4213"
+//const cardNumber = 4533787178994213;
+//const last4Digits = String(cardNumber).slice(-4);
+//console.log(last4Digits); //"4213"
4
+
5
+// Cleaner code:
6
+const last4Digits = cardNumber.toString().slice(-4);
7
+console.log(last4Digits); // "4213"
8
9
// The last4Digits variable should store the last 4 digits of cardNumber
10
// However, the code isn't working
0 commit comments