JS Binary tree