JavaScript Array Mapping: Extract Properties from Objects
It seems like you are trying to map an array of objects called "jsonData" and extract specific properties from each object. However, the code snippet you provided is missing the assignment or usage of the mapped result.
To correctly map the "jsonData" array and extract the desired properties (name, level, street, area), you can use the following code:
const mappedData = this.jsonData.map(item => [item.name, item.level, item.street, item.area]);
This will create a new array called "mappedData" that contains arrays for each object in "jsonData", with the desired properties extracted.
原文地址: https://www.cveoy.top/t/topic/qb7w 著作权归作者所有。请勿转载和采集!