Array (4th test)

#211 · closed · 1 comments

View on GitHub ↗

thenoobtester

In the 4th test in the array category, it is asked: "you should be able to remove all instances of a value from an array, returning the original array" I return the original array with all instances of the given value removed, thus successfully passing the first two expects in the test: ``` expect(result).to.have.length(3); expect(result.join(' ')).to.eql('1 3 4'); ``` but then fail to pass: ``` // make sure that you return the same array instance expect(result).equal(a); ``` with the error message: ` AssertionError: expected [ 1, 3, 4 ] to equal [ 1, 2, 2, 3, 4, 2, 2 ]` which means that the test is impossible to solve. How can I return the original array minus the specified value and at the same time have it still be equal to its original state?` expect(result).equal(a); `doesn't seem the test that it's the same instance but rather the same content.

Comments

thenoobtester

After re-reading I realized I had made a error in my code. Sorry.