-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial.js
More file actions
35 lines (35 loc) · 1.22 KB
/
initial.js
File metadata and controls
35 lines (35 loc) · 1.22 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
32
33
34
35
export default [
{
name: 'Create Array',
time: 10,
prompt: 'Create and return an array that contains \'apple\' and \'banana\'',
given: 'const fruits = [];\rreturn fruits;',
answer: 'const fruits = [\'apple\', \'banana\'];\n return fruits;',
tests: [{
name: 'Correct output',
test: 'assert.deepEqual(output, [\'apple\', \'banana\']) === undefined;'
}, {
name: 'Returns an Array',
test: 'assert.isArray(output) === undefined;'
}, {
name: 'Array has 2 items',
test: 'assert.lengthOf(output, 2) === undefined;'
}]
}, {
name: 'Array.pop()',
time: 10,
prompt: 'Remove \'orange\' from the end of the \'fruits\' array and return \'fruits\'.',
given: 'const fruits = [\'apple\', \'banana\', \'orange\'];\r',
answer: 'const fruits = [\'apple\', \'banana\', \'orange\'];\n fruits.pop();\n return fruits;',
tests: [{
name: 'Correct output',
test: 'assert.deepEqual(output, [\'apple\', \'banana\']) === undefined;'
}, {
name: 'Returns an Array',
test: 'assert.isArray(output) === undefined;'
}, {
name: 'Array has 2 items',
test: 'assert.lengthOf(output, 2) === undefined;'
}]
}
]