Skip to content

Commit 75176a9

Browse files
committed
updated comment that String() was used
1 parent 6fff84a commit 75176a9

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
@@ -11,4 +11,5 @@ const last4Digits = String(cardNumber).slice(-4);
1111
// Card Number is declared as a number and not a string, so slice won't work.
1212
console.log(last4Digits);
1313
// Yes this is what I predicted. The error is - cardNumber.slice is not a function.
14-
// I used a template literal because it will automatically convert the number to a string before slicing.
14+
// I used String() to convert the number to a string before slicing.
15+

0 commit comments

Comments
 (0)