这是代码片段。我想访问每个内部的 imagePath 数组。
...
const imagePath=[];
req.files.images.forEach(async (image) => {
let extName = path.extname(image.name);
var dest = path.join(__dirname, '..', 'public', 'images', 'items');
var imgPath = await saveFile(image, dest, itemName, extName);
imagePath.push(imgPath); // this line
})
...
函数式编程
慕村225694
随时随地看视频慕课网APP
相关分类