Module 5 of 35 · Text
#05
// A sintaxe para esta função é válida, mas há um erro, localize-o e corrija-o.
function trimWord(word) {
return wordtrim();
}
function getWordLength(word) {
return "word".length()
}
function multiply(a, b, c) {
a * b * c;
return;
}
/* ======= TESTS - DO NOT MODIFY ===== */
function test(test_name, expr) {
let status;
if (expr) {
status = "PASSED"
} else {
status = "FAILED"
}
console.log(`${test_name}: ${status}`)
}
test("fixed trimWord function", trimWord(" CodeYourFuture ") === "CodeYourFuture")
test("fixed wordLength function", getWordLength("A wild sentence appeared!") === 25)
test("fixed multiply function", multiply(2,3,6) === 36)