forked from RBK-RebootKampTunisiaCohort3/warmUp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwarmUp3.js
19 lines (16 loc) · 867 Bytes
/
warmUp3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 1 - Write functions larger and smaller that each accept two strings as arguments, and return the larger and smaller strings, respectively
// 2 - Write a function called counter that, when invoked, always returns a number that is one more than the previous invocation. For instance:
// function counting(n) {
// TODO: your code here
// }
// counting(5); // => '1, 2, 3, 4, 5'
// counting(1); // => '1'
// counting(3); // => '1, 2, 3'
// 3 - Meet & Greet: n numbers are coming to a party for numbers. Introduce them each to all the guests as they arrive. You should end up with output looking something like this one for n = 5
// welcome 1
// welcome 2, meet 1
// welcome 3, meet 1 and 2
// welcome 4, meet 1, 2 and 3
// welcome 5, meet 1, 2, 3 and 4
//
// 4- Write a function shortestWord that works like longestWord, but returns the shortest word instead.