Implementation of common data structures in JavaScript