The following JavaScript code recursively goes through the whole object, an array of objects, or a collection of both to verify if the given key exists somewhere down the object. It does not require the path to the key in advance.
A similar recursive solution as below can also be used to modify all the keys of a deeply nested object or array of objects.
[Read More]