Depends on your expectations. This is a case where we are deleting the root, with only a right child. Originally I just returned t.right. It failed the tests because the tests expect remove to return the same object t in test/bst.js:89. In this case === is not comparing the structure of the objects, its basically just comparing pointers.