I need help with this code please:
How would I be able to filter the overallAccounts list so that only the usernames of the athletes are appended into the filteredSportsUsernames?
(Attached is the picture of the code and the text is below)
Thanks,
var overallAccounts = getColumn(“Most Followed Instagram Accounts”, “Username”);
var sportsUsernames = getColumn(“Most Followed Instagram Accounts”, “Username”);
var sportsFollowers = getColumn(“Most Followed Instagram Accounts”, “Followers in millions”);
var sportsSport = getColumn(“Most Followed Instagram Accounts”, “Profession/Activity”);
var musicUsername = getColumn(“Most Followed Instagram Accounts”, “Username”);
var musicFollowers = getColumn(“Most Followed Instagram Accounts”, “Followers in millions”);
var filteredSportsSport = ;
var filteredSportsUsernames = ;
onEvent(“backMusicButton”, “click”, function( ) {
setScreen(“homeScreen”);
});
onEvent(“backSportsButton”, “click”, function( ) {
setScreen(“homeScreen”);
});
onEvent(“sportsButton”, “click”, function( ) {
setScreen(“sportsScreen”);
});
for (var i = 0; i < sportsSport.length; i++) {
if (getColumn(“Most Followed Instagram Accounts”, “Profession/Activity”) == (“Footballer” || (“Cricketer” || “Basketball Player”))) {
appendItem(filteredSportsSport, __);
}
}
for (var i = 0; i < overallUsernames.length; i++) {
if (getColumn(“Most Followed Instagram Accounts”, “Username”) == (“Footballer” || (“Cricketer” || “Basketball Player”))) {
appendItem(filteredSportsUsernames, __);
}
}