For the life of me I can not figure out where I have messed up with the below code. It works just fine when I run it in console but when I bring it into Nightbot I get “Right-hand side of ‘instanceof’ is not an object”. If anyone has any ideas I would greatly appreciate them.
$(eval
var gameJson = $(urlfetch json https://api.myjson.com/bins/18t5d6);
var gameData = [];
var sortedData = [];
var printTxt = 'The Scores Are: \n';
for (var i in gameJson)
{
gameData.push([gameJson[i], i])
}
sortedData = gameData.sort().reverse()
for (var x in sortedData)
{
printTxt += (sortedData[x][1] + ': ' + sortedData[x][0] + '\n')
}
)