Coding task · JavaScript and TypeScript course · Module 9: Design Patterns and Architecture
Exercise: Visitor System
Create a visitor system with tickets, location tracking and zone statistics.
Task
The index.js file has a VisitorManagementSystem class that keeps visitors in a Map under their ticket number. Fill in the blanks: ___BLANK1___ is the Map method that returns the visitor for a ticket number, ___BLANK2___ is the array method that turns the list of visitors into one object with the number of people in each zone (it starts from an empty object {}), and ___BLANK3___ is the Map property with the number of stored visitors. trackVisitorLocation should return false for an unknown ticket, and getStats() should return { total, byZone }, e.g. { total: 2, byZone: { entrance: 1, raptors: 1 } }.