implementations of different data structures in JavaScript