То, чего я хотел добиться, - это преобразовать массив объекта в объект.
mycode
var arr = data.questions
var obj = {};
for (let i = 0; i < arr.length; i++) {
obj[arr[i].key] = arr[i].value;
}
console.log(obj)
результат
data
(2) [{…}, {…}]
0: {id: 48, questionaire: 94, question: "Helloworld", input_answer: null, order: 0, …}
1: {id: 49, questionaire: 94, question: "sadasdas", input_answer: null, order: 1, …}
length: 2
__proto__: Array(0)
хочу достичь
questions {id: 11, questionaire: 16, question: "what?", input_answer: null, order: 0, …}