linkedlist.js in TypeScript