Task: Implement a simple Plane and Airport system to support landing logic used by the tests.
What to implement
A Plane class with:
land(airport): instructs the given airport to receive this plane and marks the plane as being in an airport.
isInAirport(): returns a boolean indicating whether the plane has landed at any airport (true after a successful landing).
The plane should start not in an airport (false).
An Airport class with:
maxCapacity(): returns the maximum number of planes the airport can hold (default: 20).
planes(): returns an array of planes that have landed at this airport (not deduplicated; duplicates allowed if the same plane lands multiple times).
receivePlane(plane): internal method (invoked by Plane.land) that:
pushes the plane into the airport’s internal list if there is available capacity.
throws an Error with message "Airport full!" if the airport has reached its capacity.
Behavior requirements
When a plane lands at an airport for the first time, the airport’s planes() array should include that plane, and plane.isInAirport() should return true.
The same Plane instance can land multiple times, causing duplicates in the airport’s planes() array, until the capacity is reached.
After the airport is at full capacity, any further landing attempts should throw an Error with the exact message: "Airport full!".
Files to create (placed under /app/)
app/plane.js
Exports a Plane class with methods land(airport) and isInAirport().
app/airport.js
Exports an Airport class with methods maxCapacity(), planes(), and a receivePlane(plane) method used by Plane.land.
Optional bootstrap (for test environments that rely on globals):
app/index.js
Exports { Plane, Airport } and (if desired) assigns global.Plane = Plane and global.Airport = Airport for convenience in tests.
Notes
The default capacity can be 20.
Do not perform deduplication of planes in airport.planes(); the same plane landing multiple times should be allowed until capacity is reached.
Ensure error text matches exactly: "Airport full!" (including the exclamation mark).