Some parts of a BST in JS