Search⌘ K
AI Features

Challenge: Composite Pattern

Explore how to apply the composite design pattern to implement a directory system in JavaScript. This lesson helps you understand the structure of components, leaves, and composites through a hands-on challenge, enabling you to model files and folders with properties such as name, size, and last modification time.

Problem statement

In this challenge, you have to implement a directory system using the composite pattern.

You have been given the ...