Skip to content

Commit b84a082

Browse files
committed
updated answer in errors 3.js
1 parent 7764876 commit b84a082

File tree

1 file changed

+2
-2
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const cardNumber = '4533787178994213';
2-
const last4Digits = cardNumber.slice(-4);
1+
const cardNumber = 4533787178994213;
2+
const last4Digits = String(cardNumber).slice(-4);
33

44
// A number was not able to be sliced, whereas a string can be sliced
55
// So, the error is that cardNumber should be a string, not a number

0 commit comments

Comments
 (0)