const coba = {
tes:{
oke:2
}
}
Object.assign(coba.tes, {sip:3})
coba.limit = 5
coba.order = [['sequenceOrder', 'ASC']];
// -------
const query = {
keyword: 'coba'
}
const keywords = [];
if (query.keyword) {
const fields = ['header','description'];
for (const field of fields) {
keywords.push({
[field]: {
['cek']: `%${query.keyword}%`
}
});
}
}
console.log(keywords)