I have this code to add key value pair to object
for (var j = 0; j < words.length; j++) {
let criteria={};
let header=headers[j];
Object.assign(criteria, { header: words[j]} );
..
}
i want to add multiple key value pairs
Object.assign(criteria, { header: words[j]} );
here header
is a variable but when i console normal header text is displayed.
the resulting object should look like something like this
{designation : 'Manager',address:'UK',...}
Any solution Thanks