Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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])
        }
    })
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Find #objects #levels #JSON
ADD COMMENT
Topic
Name
3+3 =