1.Campground reservations, part 4: Available capacity
Keep it up! You're doing great.
What's the capacity of the nonreserved sites?
We want to know how many more guests we can accommodate, on thesites that aren't reserved right now. Can you help us?
Given a campgrounds array, return the total number ofpeople the campground can host, on the sites that aren't reservedright now. In other words, if all the currently available campsiteswere filled to maximum capacity, how many people would that be?Name your function additionalCapacity.
Dataset
As a reminder, the data looks like this. It's an array with abunch of campsite objects in it. Here is a small subset of the datato give you an idea:
Answer in JavaScript
2.
Campground reservations, part 5: Count campsites by type ofview
Keep it up! You're doing great.
How many campsites are there with each kind of view?
We need to know how many campsites we have with each kind ofview, regardless of whether they are currently reserved or not. Canyou help us?
Write a function called countByView that takes twoarguments:
It should return the total number of campsites with the viewmatching the input string, regardless of whether it is currentlyreserved or not.
Here's an example:
Dataset
As a reminder, the data looks like this. It's an array with abunch of campsite objects in it. Here is a small subset of the datato give you an idea:
Answer in JavaScript
1.Campground reservations, part 4: Available capacity Keep it up! You're doing great. What's the capacity of the nonrese
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am