Binary Trees representations in JavaScript