JSFiddle - React, Tailwind, and code Playground
JavaScript
var findOpponent = function(opponent, games) {
};
var games = [
{ score: [4, 1], opponent: "Oakland" },
{ score: [1, 0], opponent: "Illinois State" },
{ score: [5, 2], opponent: "TCU" },
{ score: [3, 1], opponent: "Saint Louis" },
{ score: [1, 2], opponent: "Washington" },
{ score: [1, 0], opponent: "Portland" },
{ score: [1, 0], opponent: "Northern Kentucky" },
{ score: [0, 0], opponent: "Indiana" },
{ score: [1, 3], opponent: "Purdue" },
{ score: [2, 1], opponent: "Rutgers" },
{ score: [2, 1], opponent: "Maryland" }
];
alert("Searching for \"Purdue\"...\n" +
"Your function returns: " +
JSON.stringify(findOpponent("Purdue", games)));