I'm using this array to specify the properties I want to operate on. I didn't use for..in
because there's a property that doesn't follow the same pattern.
const data = {};
[
'teaching_levels',
'axes',
'accessibility_resources',
'contents',
'resources',
].forEach((name) => {
data[name] = {
options: results[name],
values: req.query[name],
};
});
// This property is different
data.licenses = results.licenses;
Is it alright to have an array like that?