forked from BushraAlabsi/Toy_Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings2.js
More file actions
19 lines (16 loc) · 756 Bytes
/
Copy pathstrings2.js
File metadata and controls
19 lines (16 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Given a sequence of items and a specific item in that sequence, return the item
// immediately following the item specified. If the item occurs more than once in a sequence,
// return the item after the first occurence. This should work for a sequence of any type.
// When the item isn't present or nothing follows it, the function should return null
// nextItem([1, 2, 3, 4, 5, 6, 7], 3) # 4
// nextItem("testing", "t") # "e"
function nextItem(items, elem){
//your code is here
}
// We need a function that can transform a number into a string.
// What ways of achieving this do you know?
// numberToString(123); // returns '123';`
// numberToString(999); // returns '999';`
function numberToString(num) {
//your code is here
}