-
Notifications
You must be signed in to change notification settings - Fork 30
/
W4D4.js
48 lines (31 loc) · 1.45 KB
/
W4D4.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
37
38
39
40
41
42
43
44
45
46
/*
1-Write a function myFavoriteSong which takes in no arguments (input values),
but returns an object with the properties title, artist,
and durationInSeconds. The values of each property is up to you,
and you can explicitly type out these values,
but these three properties should exist within the object your function returns.
function myFavoriteSong() {
}
Calling your function should result in something like:
myFavoriteSong(); //{title: "Countdown", artist: "Beyonce", durationInSeconds: 212}
*/
/*
2-Write a function called nextTwoBusTimes that takes an array of numbers representing (in minutes)
when the busses come for the day.
Your function should return a string which denotes when the nearest bus arrives, and the one after that.
function nextTwoBusTimes(timesArr) {
}
Calling your function should result in something like:
var bus10Schedule = [12, 24, 35, 47, 60];
nextTwoBusTimes(bus10Schedule); //"The next 2 busses arrive in 12 and 24 minutes."
*/
/*
3-Write a function called nextAndLastBusTimes that takes an array of numbers representing (in minutes)
when the busses come for the day.
Your function should return a string which denotes when the nearest bus arrives, and the last for the day.
function nextAndLastBusTimes(timesArr) {
}
Calling your function should result in something like:
var bus10Schedule = [12, 24, 35, 47, 60];
nextAndLastBusTimes(bus10Schedule); //"The next bus is in 12 minutes. The last bus is in 60 minutes.
*/