Abstract Data Type Data Structure (ADT) JavasScript