Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

arrays inside array of objects

var response = {data: [{users: [1,2,3]}, {users: [4,5,6]}]}

var users = response.data.map(o => o.users)

const usersCollection = [].concat(...users)

console.log(usersCollection)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #arrays #array #objects
ADD COMMENT
Topic
Name
4+6 =