Skip to content

Commit c4c1e6f

Browse files
In random errors .4 I explained why the code didn't work and that we need to changw the card number to string if we want to use .slice( ) function.
1 parent d0a5241 commit c4c1e6f

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ console.log(last4Digits);
99
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
1010
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1111

12-
I exepected first that the .slice negative value (-4) will count from the beganning and drob of the first four Number.
12+
I exepected first that the .slice negative value (-4) will count from the beganning and drob of the first four Numbers.
1313
When I run the code the error was that the cardNumber is not a function,
1414
so I thought that I might need to turn the code into a function,
15-
but when I checked an AI toolbarit showed that .slice is a methode that is used for string and array ,
16-
so the card number should turned into a string by addint .tostring after the card number and then use the .slice method to get the last 4 last4Digits.
15+
but when I checked an AI toolbar it showed that .slice is a methode that is used for string and array ,
16+
so the card number should turned into a string by add .tostring after the card number and then use the .slice method to get the last 4 last4Digits.

0 commit comments

Comments
 (0)