Array transformation/manipulation
问题 I have one array like this one: array1=[{value:1, label:'value1'},{value:2, label:'value2'}, {value:3, label:'value3'}] I have a second array of integer : array2=[1,3] I would like to obtain this array without a loop for : arrayResult = ['value1', 'value3'] Does someone know how to do it with javascript ? Thanks in advance 回答1: Map the elements in array2 to the label property of the element in array1 with the corresponding value : array2 // Take array2 and .map( // map function(n) { // each