Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit 77d2ae1

Browse files
committed
syntax-error.js file is done
1 parent c91bfe1 commit 77d2ae1

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

week-1/2-mandatory/1-syntax-errors.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
// There are syntax errors in this code - can you fix it to pass the tests?
44

5-
function addNumbers(a b c) {
5+
function addNumbers(a, b, c) {
66
return a + b + c;
77
}
88

9-
function introduceMe(name, age)
10-
return "Hello, my name is " + name "and I am " age + "years old";
9+
function introduceMe(name, age){
10+
return "Hello, my name is " + name + " and I am " + age + " years old";
11+
}
1112

12-
function getAddition(a, b) {
13-
total = a ++ b
13+
function getRemainder(a, b) {
14+
1415

1516
// Use string interpolation here
16-
return "The total is %{total}"
17+
let Reminder=a%b;
18+
return `The remainder is ${a%b}`;
1719
}
1820

1921
/* ======= TESTS - DO NOT MODIFY ===== */
@@ -23,14 +25,14 @@ function getAddition(a, b) {
2325
function test(test_name, expr) {
2426
let status;
2527
if (expr) {
26-
status = "PASSED"
28+
status = "PASSED";
2729
} else {
28-
status = "FAILED"
30+
status = "FAILED";
2931
}
3032

31-
console.log(`${test_name}: ${status}`)
33+
console.log(`${test_name}: ${status}`);
3234
}
3335

34-
test("fixed addNumbers function - case 1", addNumbers(3,4,6) === 13)
35-
test("fixed introduceMe function", introduceMe("Sonjide",27) === "Hello, my name is Sonjide and I am 27 years old")
36-
test("fixed getRemainder function", getRemainder(23,5) === "The remainder is 3")
36+
test("fixed addNumbers function - case 1", addNumbers(3,4,6) === 13);
37+
test("fixed introduceMe function", introduceMe("Sonjide",27) === "Hello, my name is Sonjide and I am 27 years old");
38+
test("fixed getRemainder function", getRemainder(23,5) === "The remainder is 3");

0 commit comments

Comments
 (0)