Question: I have an array of strings and a params object like this. How do I create the params constant? Using either forEach, map, and or filter?

```
key = ['dog', 'car', 'cat'];
value = [ 3, 1, 2 ];

    const params = {
       item: {
           [key]: value[0],
           // more keys to be appended
       }
    }

```

Answer: 
Just looping through each value:

```js
const key = ['dog', 'car', 'cat'];
const value = [ 3, 1, 2 ];

const item = {};
key.forEach((k, i) => { item[k] = value[i]; });

const parmas = {};
parmas.item = item;
console.log(parmas);
```
You could do it this way:

```
value.reduce((acc, val, index) => (acc[key[index]] = val, acc), {});

```

This produces:

{dog: 3, car: 1, cat: 2}