Skip to content

Commit 3438439

Browse files
committed
I didn't realise at first that splice actually modified daysOfWeek. I have added a test to make this clear
1 parent 257fd94 commit 3438439

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

topics/about_arrays.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,31 @@ $(document).ready(function(){
99
equals(favouriteThings[1], __, 'what is in the second position of the array?');
1010
equals(favouriteThings[2], __, 'what is in the third position of the array?');
1111
});
12-
12+
1313
test("array type", function() {
1414
equals(typeof([]), __, 'what is the type of an array?');
1515
});
16-
16+
1717
test("length", function() {
1818
var collection = ['a','b','c'];
1919
equals(collection.length, __, 'what is the length of the collection array?');
2020
});
21-
21+
2222
test("delete", function() {
2323
var daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
2424
var workingWeek = daysOfWeek.splice(__, __);
2525
ok(workingWeek.equalTo([__]), 'what is the value of workingWeek?');
26+
ok(daysOfWeek.equalTo([__]), 'what is the value of daysOfWeek?');
2627
});
27-
28+
2829
test("stack methods", function() {
2930
var stack = [];
3031
stack.push("first");
3132
stack.push("second");
32-
33+
3334
equals(stack.pop(), __, 'what will be the first value poped off the stack?');
3435
equals(stack.pop(), __, 'what will be the second value poped off the stack?');
3536
});
36-
37+
3738
});
3839

0 commit comments

Comments
 (0)