Skip to content

Commit 0e93b52

Browse files
committed
error correction
1 parent 4c2c13b commit 0e93b52

File tree

1 file changed

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

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Predict and explain first...
2-
// =============> write your prediction here
1+
/"hello Mhairi" === `hello ${mhairiName}`;
2+
"${mhairiName} is 28" === `Mhairi is ${mhairiAge}`;
33

4-
// call the function capitalise with a string input
5-
// interpret the error message and figure out why an error is occurring
4+
// My answer is:
5+
const mhairiName = "Mhairi";
6+
const mhairiAge = 28;
67

7-
function capitalise(str) {
8-
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
9-
return str;
10-
}
8+
const sentence1= `hello ${mhairiName}`;
9+
console.log(sentence1); // ➜ Output: hello Mhairi
1110

12-
// =============> write your explanation here
13-
// =============> write your new code here
11+
12+
const sentence= `${mhairiName} is ${mhairiAge}`;
13+
console.log(sentence); // ➜ Output: Mhairi is 28

0 commit comments

Comments
 (0)