K
K
Klein Maximus2016-04-09 11:49:41
JavaScript
Klein Maximus, 2016-04-09 11:49:41

How to recursively merge JavaScript objects?

It is necessary to combine two or more objects together with properties and methods, and it is recursive, so that all nested objects also pass into the result.
Are there built-in methods?
Maybe something appeared in ES6?
Or some library can be used?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
arctblake, 2016-04-09
@arctblake

Lodash has a defaultsDeep function (I don't remember the exact name). It seems to do just that. Look at the docks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question