implementation of javascript data structures