Skip to content

Commit 67c3257

Browse files
committed
added prediction and explanation of code
1 parent 538ff7d commit 67c3257

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/0.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
3-
2+
//This code will throw an error as we haven't passed an argument into str? or str is the function parameter and variable already on line 5 so it may throw an error to declare again as a variable inside the function?
43
// call the function capitalise with a string input
54
// interpret the error message and figure out why an error is occurring
6-
75
function capitalise(str) {
86
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
97
return str;
108
}
11-
129
// =============> write your explanation here
1310
// =============> write your new code here

0 commit comments

Comments
 (0)