For that code below the output of ins (lets assume the value of keys are summer, spring, fall, winter) is:
['req.body.summer, req.body.spring, req.body.fall, req.body.winter']
What i want is remove the string after the replace command, so i can insert it to my SQLite query. So the output must be:
[req.body.summer, req.body.spring, req.body.fall, req.body.winter]
Im just new into programming so please bear with me. Thank you!
var arr = '';
Object.keys(input).forEach(function(key) {
arr += 'req.body.' + key + ', ';
});
var ins = [arr.replace(/,\s*$/, '')];
console.log(ins);
input? An object?