當(dāng)我用 2 個(gè)對象來滿足我的要求時(shí)。當(dāng)我更改其中一個(gè)時(shí),另一個(gè)會自動更改。我如何像舊請求一樣存儲第二個(gè)請求。你可以在下面找到我的意思。我如何存儲第二個(gè)?app.post('/example', (request, response) => { const data = request.body; const copy = request.body; //This is a basic example of my problem in node.js //Example request.body[0].execution = 10 data[0].execution = 5; console.log(data[0].execution); // it shows 5 console.log(copy[0].execution); // it shows 5, I dont know why ? I need 10 like request});
當(dāng)我更改一個(gè)請求時(shí),如何存儲其他請求?
森林海
2023-09-28 10:18:37