Skip to content

Commit 1cd3d6d

Browse files
committed
fix errors without changes
1 parent 6fca6cb commit 1cd3d6d

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

  • Sprint-1/2-mandatory-errors
  • Sprint-2/1-key-errors

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const cardNumber = "4533787178994213";
2-
const last4Digits = cardNumber.slice(-4);
1+
const cardNumber = 4533787178994213;
2+
const last4Digits = cardNumber.toString().slice(-4);
33
console.log(last4Digits);
44

55
// The last4Digits variable should store the last 4 digits of cardNumber

Sprint-2/1-key-errors/0.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
// call the function capitalise with a string input
55
// interpret the error message and figure out why an error is occurring
66

7+
// function capitalise(str) {
8+
// let str = `${str[0].toUpperCase()}${str.slice(1)}`;
9+
// return str;
10+
// }
11+
12+
// =============> str has already been declared in the function.
13+
// =============>
714
function capitalise(str) {
8-
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
15+
str = `${str[0].toUpperCase()}${str.slice(1)}`;
916
return str;
1017
}
1118

12-
// =============> write your explanation here
13-
// =============> write your new code here
19+
console.log(capitalise("tommy is a good boy"));

0 commit comments

Comments
 (0)