Implement normal data-structure in javascript