topic description
there is an array, such as let arr = ["banana", "apple", "pear"];
, and then another array of objects:
let arr = ["",""""];
//
let allArr = [
{id:"001",name:"",price:"2"},
{id:"002",name:"",price:"1"},
{id:"003",name:"",price:"20"},
{id:"004",name:"",price:"22"},
{id:"005",name:"",price:"26"}
];
// :arr;
//
let finalArr = [
{id:"002",name:"",price:"1"},
{id:"001",name:"",price:"2"},
{id:"003",name:"",price:"20"}
];