Converts an array of choices into a record where the keys are the choice IDs and the values are the choice names.
const choices = [ { id: '1', name: 'Choice 1' }, { id: '2', name: 'Choice 2' },];const record = choicesToRecord(choices);console.log(record); // { '1': 'Choice 1', '2': 'Choice 2' } Copy
const choices = [ { id: '1', name: 'Choice 1' }, { id: '2', name: 'Choice 2' },];const record = choicesToRecord(choices);console.log(record); // { '1': 'Choice 1', '2': 'Choice 2' }
Converts an array of choices into a record where the keys are the choice IDs and the values are the choice names.