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 0ba4f94 commit 6349e37Copy full SHA for 6349e37
1 file changed
Sprint-1/2-mandatory-errors/3.js
@@ -14,5 +14,5 @@ const cardNumber = 4533787178994213;
14
//After running the code, I have realized that the code is not working because cardNumber is a number and the slice is a method in String class
15
//so, in order to make it work, we need to change cardNumber to String before calling the slice method
16
17
-const last4Digits = (cardNumber + "").slice(-4);
+const last4Digits = String(cardNumber).slice(-4);
18
console.log("Last four digits of card are : " + last4Digits);
0 commit comments