Trying to construct a key, value pair based on the array of objects data.

**Snippet**

```js
const cars = [{
  car: 'BMW',
  year: '2020'
}];

const result = cars.map((val) => `${val.car}|${val.year}`)

console.log(result)
```

The result I'm expecting is below. Could anyone please help?

```
[{cars: [{ car: 'BMW', year: '2020'}], key: 'BMW|2020'}]

```