-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (27 loc) · 677 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function theBeatlesPlay (musicians,instruments) {
var whoPlaysWhat = [];
for (var i = 0; i < musicians.length; i++) {
var musician = musicians[i];
var instrument = instruments[i];
whoPlaysWhat.push(musician + " plays " + instrument);
}
return whoPlaysWhat;
}
function johnLennonFacts (facts) {
var index = 0;
var exclamatedFacts = [];
while (index < facts.length) {
var fact = facts[index];
exclamatedFacts.push(fact + '!!!');
index++;
}
return exclamatedFacts;
}
function iLoveTheBeatles (num) {
var loveArray = [];
do {
loveArray.push('I love the Beatles!');
num += 1;
} while (num < 15)
return loveArray;
}