Skip to content

Commit 62528e6

Browse files
committed
correct error
1 parent 2d7234f commit 62528e6

File tree

1 file changed

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

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
//run this Code, my prediction is right. In order to fix it, first cast to string first:
1010

1111
const cardNumber=4533787178994213;
12-
const last4Digits = cardNumber.toString.slice(-4);
1312

1413
//then conver to number
15-
const last4Digits = Number(cardNumber.toString.slice(-4));
16-
console log(last4Digits);
17-
14+
const last4Digits = Number(cardNumber.toString().slice(-4));
15+
console.log(last4Digits);

0 commit comments

Comments
 (0)