i need map object data with array
const data = [
{name:"John", age:"22", weight:"60", height:"180cm"},
{name:"Emma",age:"25",weight:"55",height:"160cm"}
]
const key = ["name", "weight", "height"]
i need result like this
const result = [
{name:"John", weight:"60", height:"180cm"},
{name:"Emma", weight:"55",height:"160cm"}
]
Thanks for helping