Skip to content

Commit cd37090

Browse files
used .toString to cast the nuber date type to string and assign the value to cardNumberString
1 parent e8730e3 commit cd37090

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const cardNumber = 4533787178994213;
22
//console.log(typeof cardNumber);
3+
const cardNumberString = cardNumber.toString();
34

45
const last4Digits = cardNumber.slice(-4);
56
console.log(last4Digits); // Output: "4213"

0 commit comments

Comments
 (0)