Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Deep merging JavaScript objects into a composite object whose properties are dynamically linked to those of the merged objects

How would you write a JavaScript function which:

  1. Takes in a list of objects to be (deeply) merged and outputs a “composite object” whose key/values are the result of deeply merging these objects.

  2. Constructs this “composite object” such that: if the key/values of the original objects are changed after the composite object is created, and the composite object is queried for a key/value which depends on one of the changed values, the composite object will return a result which reflects that change (ie. the value is dynamically generated based on the current states of the original objects, and possibly memoized too)

There are a few libraries such as Lodash, deepmerge, object-accumulator, lazy-recursive-merge, Lazy.js which will do #1 above, but I know of nothing which can do #2.

How do you write a function that does both #1 and #2? Can one of the above libraries be used as a starting point for this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!