I'm trying the following code:
describe("array deletion", function () {
it("leaves a hole in middle", function () {
var array = ['one','two','three'];
delete array[1]; //'two' deleted
expect(array).toEqual(['one',undefined,'three']);
});
});
This expectation fails, but why? shouldn't it equal?