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 can set an object's keys using the following syntax:

```
obj[key] = value

```

So in you case, you could do something like:

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

var params = {
    item : {}
}

for (var i=0; i<key.length;i++){
    params.item[key[i]] = value[i];
}

```