Skip to content
Advertisement

Create an array from nested array of objects in vue [closed]

I have an object as follows:

JavaScript

I need to put all the values with the sauce key into a separate array so that I can create a menu. i need all “start_at” values inside a separate array, like:

JavaScript

in vue.js i have access “start_at” values separately, but I want them all together

Advertisement

Answer

You can use flatMap to achieve this.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement