Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter nested object array and return whole object

arrayOfElements.map((element) => {
  return {...element, subElements: element.subElements.filter((subElement) => subElement.surname === 1)}
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #nested #object #array #return #object
ADD COMMENT
Topic
Name
5+7 =