I have two arrangements:
const opciones = ['A', 'B', 'C', 'D'];
const valoracion = [true, false, false, false];
And I want to create an array containing objects with this structure, based on the data from the previous arrays:
const respuestas = [
{opc: 'A', val: true},
{opc: 'B', val: false},
{opc: 'C', val: false},
{opc: 'D', val: false},
]
How can I do it in Javascript?
Something simple would be like this: