**[ setScreen(“homeScreen”);
var conferenceList = getColumn(“NHL Teams”, “Conference”);
var teamList = getColumn(“NHL Teams”, “Team”);
var divisionList = getColumn(“NHL Teams”, “Division”);
var locationList = getColumn(“NHL Teams”, “City”);
var arenaList = getColumn(“NHL Teams”, “Arena”);
var joinedList = getColumn(“NHL Teams”, “Joined”);
var headCoachList = getColumn(“NHL Teams”, “Head coach”);
var logoList = getColumn(“NHL Teams”, “Logo”);
var filteredTeamList = ;
var filteredDivisionList = ;
var filteredLocationList = ;
var filteredArenaList = ;
var filteredJoinedList = ;
var filteredHeadCoachList = ;
var filteredLogoList = ;
onEvent(“goButton”, “click”, function( ) {
setScreen(“ConferenceScreen”);
});
onEvent(“westernButton”, “click”, function( ) {
setScreen(“factsScreen”);
for (var i = 0; i < conferenceList.length - 1; i++) {
if ((conferenceList[i]) > 15) {
}
}
});
onEvent(“easternButton”, “click”, function( ) {
setScreen(“factsScreen”);
for (var i = 0; i < conferenceList.length - 1; i++) {
if (conferenceList[i] <= 15) {
}
}
});
filter();
onEvent(“getFactsButton”, “click”, function( ) {
updateScreen();
});
onEvent(“goBackButton”, “click”, function( ) {
setScreen(“ConferenceScreen”);
});
function filter() {
for (var i = 0; i < conferenceList.length - 1; i++) {
if ((conferenceList[i]) <= 15) {
appendItem(filteredTeamList, teamList[i]);
appendItem(filteredDivisionList, divisionList[i]);
appendItem(filteredArenaList, arenaList[i]);
appendItem(filteredLocationList, locationList[i]);
appendItem(filteredJoinedList, joinedList[i]);
appendItem(filteredHeadCoachList, headCoachList[i]);
appendItem(filteredLogoList, logoList[i]);
}
}
}
function updateScreen() {
var i = randomNumber(0, teamList.length -1 );
setText(“teamNameArea”, " Team name: " + filteredTeamList[i]);
setText(“divisionTextArea”, “Divison:” + filteredDivisionList[i]);
setText(“locationTextArea”, "Location: " + filteredLocationList[i]);
setText(“arenaTextArea”, "Arena: " + filteredArenaList[i]);
setText(“joinedTextArea”, "Year Joined: " + filteredJoinedList[i]);
setText(“headCoachTextArea”, "Head Coach: " + filteredHeadCoachList[i]);
setImageURL(“logoArea”, filteredLogoList[i]);
}
]**
Link to the project or level: [ App Lab - Code.org ]
What I expect to happen: [the code should run and produce the correct information for each each text box output. The data set NHL teams is being used and the app is meant to produce a random team name with the corresponding division, location, arena, year joined, and head coach. ]
What actually happens: [no errors or issues seem to be flagged but when the program is run, the text boxes are populated with “undefined” for all areas ]