Implement Binary Search Tree Javascript Code