Skip to content

Commit 718a5a4

Browse files
committed
amend
1 parent d7dbde9 commit 718a5a4

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@
1111
const cardNumber=4533787178994213;
1212

1313
//then conver to number
14-
const last4Digits = Number(cardNumber.toString().slice(-4));
14+
const last4Digits = cardNumber.toString().slice(-4);
1515
console.log(last4Digits);
16+
17+
// or i can put quotes on cardNumber which will be string
18+
const cardNumber ="4533787178994213"
19+
const last4Digits = cardNumber.slice(-4);
20+
console.log(last4Digits)

0 commit comments

Comments
 (0)