I have formdata i stringify that looks like this
(我有formdata我将看起来像这样)
{"name":"jack miller", "address":"123 main st"}
I want to append more records but i was getting "append is not a function"
(我想追加更多记录,但我却收到“追加不是函数”)
goal to have this {"name":"jack miller", "address":"123 main st"}, {"name":"new guy", "address":"new address"}
(目标是拥有这个{“ name”:“ jack miller”,“ address”:“ 123 main st”},{“ name”:“ new guy”,“ address”:“ new address”})
const s = this hold master data
const data = new FormData(e.target);
let m = JSON.stringify(Object.fromEntries(data));
let c = s.concat(m) // concat doesn't include a comma
let d = s.append(m) // append throw error of append is not a function
So while i tend to have json strings, i could convert to object or array and then back if that is better or easier to append etc..
(因此,尽管我倾向于使用json字符串,但我可以将其转换为对象或数组,然后再转换为更好或更容易附加的类等。)
Why doesn't append work?
(为什么不附加工作?)
ask by Jeremy Miller translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…