Answers for "Find all objects in different levels of JSON"

0

Find all objects in different levels of JSON

const iterate = (obj) => {
    Object.keys(obj).forEach(key => {

    console.log(`key: ${key}, value: ${obj[key]}`)

    if (typeof obj[key] === 'object') {
            iterate(obj[key])
        }
    })
}
Posted by: Guest on September-08-2021

Code answers related to "Find all objects in different levels of JSON"

Code answers related to "Javascript"

Browse Popular Code Answers by Language