Home > Back-end >  Where am I going wrong? While inspecting code it shows error
Where am I going wrong? While inspecting code it shows error

Time:01-05

const question = [
    {
        question: 'which one of these is a javascript?',
        answers: [
            { text: 'python', correct: False },
            { text: 'django', correct: False },
            { text: 'React', correct: True },
            { text: 'Eclipse', correct: False }
        ],

Can you please resolve the JavaScript problem?

CodePudding user response:

const question = [
{
    question: 'which one of these is a javascript?',
    answers: [
        { text: 'python', correct: false },
        { text: 'django', correct: false },
        { text: 'React', correct: true },
        { text: 'Eclipse', correct: false }
    ],
}] // added this line (problem was these missing closing brackets)

CodePudding user response:

Problem was with your closing brackets and booleans were not in lower case

const question = [
  {
    question: 'which one of these is a javascript?',
    answers: [
        { text: 'python', correct: false },
        { text: 'django', correct: false },
        { text: 'React', correct: true },
        { text: 'Eclipse', correct: false }
    ],
  },
];
  • Related