Coding task · JavaScript and TypeScript course · Module 9: Design Patterns and Architecture

Exercise: Project Structure

Build the core of the park system with a module registry kept in a Map.

Task

The index.js file has a ParkCore class that keeps the park modules in a Map (this.modules). Fill in the blanks with Map methods: ___BLANK1___ checks whether a module name is already taken (then registerModule returns false and does not overwrite the module), ___BLANK2___ returns the module stored under a name, and ___BLANK3___ goes through all modules so that init() calls init() of every module that has it and returns the number of initialized modules.