-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathproblem1.js
More file actions
31 lines (25 loc) · 1.02 KB
/
Copy pathproblem1.js
File metadata and controls
31 lines (25 loc) · 1.02 KB
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
// You are not allowed to use a for loop or a while loops for any of these questions. Instead, use filter, map, etc...
function removeEvens(lst) {
// lst is an array of numbers
// Returns a new list with all the even numbers of lst removed
}
function keepLong(lst) {
// lst is an array of strings
// Returns a new list with all the elements of lst that are length greater than 5
}
function greet(lst) {
// lst is an array of strings
// Adds "Hello " to every element of greet
// For example: greet(["bob", "eric"]) returns ["Hello bob", "Hello eric"]
}
function greetLong(lst) {
// lst is an array of strings
// Only greet people who's names have length at least 4.
// Otherwise ignore them completely.
// For example: greeLong(["bob", "daniel"]) returns ["Hello daniel"]
}
function allLong(lst) {
// lst is an array of strings
// Returns true if every element of lst is of length at least 5. Otherwise returns false.
}
module.exports = {removeEvens, keepLong, greet, greetLong, allLong};