Data structures prototypes in javascript