-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6-lane-names.js
More file actions
38 lines (29 loc) · 794 Bytes
/
6-lane-names.js
File metadata and controls
38 lines (29 loc) · 794 Bytes
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
/*
You are given a list of some London street names.
Write a function that will return all street names which contain 'Lane' in their name.
*/
function getLanes() {
}
/* ======= TESTS - DO NOT MODIFY ===== */
const streetNames = [
"Abchurch Lane",
"Adam's Court",
"Addle Hill",
"Addle Lane",
"Alban Highwalk"
]
const util = require('util');
function test(test_name, actual, expected) {
let status;
if (util.isDeepStrictEqual(actual, expected)) {
status = "PASSED";
} else {
status = `FAILED: expected: ${util.inspect(expected)} but your function returned: ${util.inspect(actual)}`;
}
console.log(`${test_name}: ${status}`);
}
test(
"getLanes function works",
getLanes(streetNames),
["Abchurch Lane", "Addle Lane"]
);