Skip to content

Commit a976af7

Browse files
author
kohanman
committed
completed coursework sprint 2.0
1 parent 8f3d6cf commit a976af7

File tree

1 file changed

+9
-1
lines changed
  • Sprint-2/1-key-errors

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@
55
// interpret the error message and figure out why an error is occurring
66

77
function capitalise(str) {
8-
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
8+
var str = `${str[0].toUpperCase()}${str.slice(1)}`;
99
return str;
1010
}
11+
capitalise(hello);
1112

1213
// =============> write your explanation here
14+
//cant overwrite the str variable with a new parameter, because it is let instead of var
1315
// =============> write your new code here
16+
17+
function capitalise(str) {
18+
var str = `${str[0].toUpperCase()}${str.slice(1)}`;
19+
return str;
20+
}
21+
capitalise("hello"");

0 commit comments

Comments
 (0)