Newbie to teaching CSP and I have a couple of students having this issue with their code, on line 71 they are trying to pull a single number from the dataset based on their dropdown selection and display that, but instead it is pulling the whole list of numbers for all the airports. I’m sure it is something quite simple, but I can’t see to figure it out. Any guidance would be much appreciated!
Let’s narrow that program down to two lines of code:
var totalPassengersList = getColumn("Busiest Airports", "Total Passengers");
setText("leastAmountDisplay", totalPassengersList + "People");
This should obviously put a list of numbers followed by People into that text box and it does:
The question you need to ask yourself is did he fire six shots or only five?1 No, sorry, wrong question. You need to ask which one of those you want to show. Do you want a random airport with less than 50000000 passengers? Do you want the airport with the lowest passengers?
1 Warner Bros. (1971). Dirty Harry . United States.
2 Likes