Skip to content

Commit af905fc

Browse files
added tests to extra check the function
1 parent eb5ff4a commit af905fc

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Predict and explain first...
22
// =============> I presume the str is repeatedly declared, first as a parameter and again as a variable.
3-
4-
53
// call the function capitalise with a string input
64
// interpret the error message and figure out why an error is occurring
75

@@ -19,3 +17,4 @@ OR
1917
function capitalise(str) {
2018
return `${str[0].toUpperCase()}${str.slice(1)}`;
2119
}
20+
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Predict and explain first...
2-
32
// Why will an error occur when this program runs?
43
// =============> The error will appear because we are trying to log the variable decimalNumber in the function. We have to call the function at this point. Besides to that, the decimalNumber is again declared inside the function where it shouldn't be.
54

Sprint-2/2-mandatory-debug/2.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function getLastDigit(num) {
1212
console.log(`The last digit of 42 is ${getLastDigit(42)}`);
1313
console.log(`The last digit of 105 is ${getLastDigit(105)}`);
1414
console.log(`The last digit of 806 is ${getLastDigit(806)}`);
15+
console.log(`The last digit of 7247 is ${getLastDigit(7274)}`);
1516

1617
// Now run the code and compare the output to your prediction
1718
/* ===========> function getLastDigit() {

0 commit comments

Comments
 (0)