Can someone please tell me what is wrong with this code?
//Choosing an option in dropdown will give random song result
var viral = [(getColumn("Viral 50 USA", "Position"))];
var filteredList = [];
onEvent("dropdown1", "input", function( ) {
tenFilter();
setProperty("text_area1", "text", filteredList);
});
//Filters songs by Top 10
function tenFilter() {
for (var i = 0; i < viral.length; i++) {
var top10 = viral[i].substring(1, 10);
if (top10 >= 10) {
appendItem(filteredList, viral[I]);
}
}
return filteredList;
}
//
“`
I get this error in the debug console:
ERROR: Line: 11: TypeError: viral[i].substring is not a function"