Build a Quiz Game - Build a Quiz Game

Tell us what’s happening:

whats wrong?? the getResults function should take the question object as the first parameter and the computerChoice asb the second which i have done and the code is not passing

Your code so far

const questions = [{
  category: "Javascript",
  question: "Are Strings Immutable?",
  choices: ["No", "Yes", "I dont know"],
  answer: "No",
},
   {
     category: "Html",
  question: "what is <h></h> element used for?",
  choices: ["To create a new paragraph", "For headings in page", "I don't know"],
  answer: "For headings in page",
   },
    {
      category: "Css",
  question: "what is the function of css in web design?",
  choices: ["Edit the background", "Give colors to html", "I don't have an idea"],
  answer: "Edit the background",
    }, 
      {
        category: "Python",
  question: "Can Python syntax can be executed by writing directly in the Command Line?",
  choices: ["No", "Yes", "I dont know"],
  answer: "No",
      }, 
        {
          category: "React",
  question: "Can I use React Native without a Framework?",
  choices: ["No", "Yes", "I dont know"],
  answer: "Yes",
        }
];

function getRandomQuestion(questions) {
      return questions[Math.floor(Math.random() * questions.length)];
}

function getRandomComputerChoice(choices) {
     return choices[Math.floor(Math.random() * choices.length)];
}

function getResults(question, choices) {
    
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Quiz Game - Build a Quiz Game

you may need to write code inside getResults for the function to pass

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.