Abstract Data Types in JavaScript - for learning purposes