[Solved] Push and select data from Array of Objects


besides lack of info provided , this might help you build your own

 var dataQuestions = [ {
        question : 1,
        response : 3,
    },{
        question : 2,
        response : 7,
    },{
        question : 3,
        response : 5,
    }];
    
function addQ(){
        var question = parseInt(document.getElementById("question").value);
    var response = parseInt(document.getElementById("response").value);
    dataQuestions.push(
        {
       question: question,
       response : response
      }
    )
    console.log(dataQuestions);
}

function getResp(){
    var getResp = parseInt(document.getElementById("getresponse").value);
  var res = dataQuestions.find(q=>q.question===getResp);
  console.log(res.response)
}
<label for="question">Question:</label>
<input type="text" id="question" ><br><br>
<label for="response">Reponse:</label>
<input type="text" id="response" >



<button onclick="addQ()">Add</button>

<br>
<br>
<label for="getresponse">Get Response of:</label>
<input type="text" id="getresponse" >

<button  onclick="getResp()">Get</button>

1

solved Push and select data from Array of Objects