Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Iterate Through an Object

const student = {
    name: 'Monica',
    class: 7,
    age: 12
}

// using for...in
for ( let key in student ) {

    // display the properties
    console.log(`${key} => ${student[key]}`);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #Iterate #Through #Object
ADD COMMENT
Topic
Name
5+9 =