DEV Community

Discussion on: Solving "Wherefore art thou" / freeCodeCamp Algorithm Challenges

Collapse
 
ttatsf profile image
tatsuo fukuchi • Edited

Another way:

const whatIsInAName = (objs, obj) =>
  objs.filter(
    e => Object.entries(obj).every(
      ([k, v]) => e?.[k] === v
    )
  )