Implement normal data-structrue in javascript