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

Commit b55ae4a

Browse files
committed
3-function-output.js is done
1 parent 6e65b44 commit b55ae4a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

week-1/2-mandatory/3-function-output.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// Add comments to explain what this function does. You're meant to use Google!
2-
function getNumber() {
2+
function getNumber() {//MAth.random()*10 return random numbers between 1 and 10
33
return Math.random() * 10;
44
}
55

66
// Add comments to explain what this function does. You're meant to use Google!
7-
function s(w1, w2) {
7+
function s(w1, w2) {//w1.concat(w2) return a new string containing the text of joined string
88
return w1.concat(w2);
99
}
1010

1111
function concatenate(firstWord, secondWord, thirdWord) {
12-
// Write the body of this function to concatenate three words together
13-
// Look at the test case below to understand what to expect in return
12+
13+
console.log(firstWord.concat(" ").concat(secondWord).concat(" ").concat(thirdWord));
14+
return firstWord.concat(" ").concat(secondWord).concat(" ").concat(thirdWord);
1415
}
1516

1617
/* ======= TESTS - DO NOT MODIFY =====
@@ -34,10 +35,12 @@ test(
3435
"concatenate function - case 1 works",
3536
concatenate("code", "your", "future") === "code your future"
3637
);
38+
3739
test(
3840
"concatenate function - case 2 works",
3941
concatenate("I", "like", "pizza") === "I like pizza"
4042
);
43+
4144
test(
4245
"concatenate function - case 3 works",
4346
concatenate("I", "am", 13) === "I am 13"

0 commit comments

Comments
 (0)