Solved RecentlyUsedList in JavaScript