hash Fun4vrJWMxMcm731h6Aoq0malfGR key photodbc2306a236d311177aee2d5a3130829png url httprt966gpvohn-bktclouddncomphotodbc2306a236d311177aee2d5a3130829png 我需要取到该对象数组的所有url并存到数据库中 请js写出最佳最简便的方法
可以使用map方法和箭头函数来实现:
const urls = arr.map(obj => obj.url);
arr为对象数组,urls为存储url的数组。然后将urls存入数据库即可。
原文地址: https://www.cveoy.top/t/topic/clcq 著作权归作者所有。请勿转载和采集!