I have this code to get an array of one object:
let selectedShop = initialResultsState.get('products')
.filter(product => product.shop.selected)
console.log(selectedShop)
result:
Can I extract the object from the array in the same operation by stringing another es6 array method to the end of filter, rather than doing let newVariable = selesctedShop[0]?
I tried to string this to it:
.map(x => {return { shop: x.shop, products: x.products }})
but it is still an array of one object because map always returns a new array.

let newVariable = selesctedShop[0]" --- what's wrong with doing that?.shift()or[0]at the end ..