Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda