Skip to content

Commit ba4eea3

Browse files
authored
Fix slice method to use cardNumber string length
1 parent c9e436f commit ba4eea3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const cardNumber = 4533787178994213;
1111
// [ChunYanWong] The slice method extract substring starting with the first parameter position
1212
// There is no -4 starting position and hence it will not work
1313

14-
const last4Digits = cardNumber.toString().slice(cardNumber.length - 4)
14+
const last4Digits = cardNumber.toString().slice(cardNumber.toString().length - 4)

0 commit comments

Comments
 (0)