Skip to content

Commit 4582d80

Browse files
committed
Sprint 1 errors: explain 3.js slice type error
1 parent 245bf0f commit 4582d80

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sprint-1/2-mandatory-errors/answers.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
- Error shown:
3030
- Why it happens:
3131
- MDN link (optional):
32+
### 3.js
33+
34+
- Error shown: `TypeError: cardNumber.slice is not a function`
35+
- Why it happens: The variable `cardNumber` is a number, and numbers do not have the `slice()` method. The `slice()` method is only available on strings and arrays.
36+
- Concept: Methods depend on data types in JavaScript.
37+
- MDN link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
38+
3239

3340
## 4.js
3441
- Error shown:

0 commit comments

Comments
 (0)