Implemented List in javascript