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

Commit 6e65b44

Browse files
committed
2-logic-error.js is done
1 parent 77d2ae1 commit 6e65b44

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// The syntax for this function is valid but it has an error, find it and fix it.
22

33
function trimWord(word) {
4-
return wordtrim();
4+
return word.trim();
55
}
66

77
function getWordLength(word) {
8-
return "word".length()
8+
return word.length;
99
}
1010

1111
function multiply(a, b, c) {
12-
a * b * c;
13-
return;
12+
13+
return a * b * c;
1414
}
1515

1616
/* ======= TESTS - DO NOT MODIFY =====
@@ -22,14 +22,14 @@ To run these tests type `node 2-logic-error` into your terminal
2222
function test(test_name, expr) {
2323
let status;
2424
if (expr) {
25-
status = "PASSED"
25+
status = "PASSED";
2626
} else {
27-
status = "FAILED"
27+
status = "FAILED";
2828
}
2929

30-
console.log(`${test_name}: ${status}`)
30+
console.log(`${test_name}: ${status}`);
3131
}
3232

33-
test("fixed trimWord function", trimWord(" CodeYourFuture ") === "CodeYourFuture")
34-
test("fixed wordLength function", getWordLength("A wild sentence appeared!") === 25)
35-
test("fixed multiply function", multiply(2,3,6) === 36)
33+
test("fixed trimWord function", trimWord(" CodeYourFuture ") === "CodeYourFuture");
34+
test("fixed wordLength function", getWordLength("A wild sentence appeared!") === 25);
35+
test("fixed multiply function", multiply(2,3,6) === 36);

0 commit comments

Comments
 (0)