Skip to content

Commit 5bc8fbe

Browse files
refactored the last4Digits variable by invoking the mehtod
1 parent 7b1645e commit 5bc8fbe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ const cardNumber = 4533787178994213;
99
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1010

1111
// I predicted the last four digits bit it has to be a string in order to use the method slice and that explain why it wasn't working
12-
const last4Digits = cardNumber.toString.slice(-4);
12+
const last4Digits = cardNumber.toString().slice(-4);
13+
console.log(last4Digits)

0 commit comments

Comments
 (0)