Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Iterate Over an Array Using For Loop</title> </head> <body> <script> // An object with some properties var person = {"name": "Clark", "surname": "Kent", "age": "36"}; // Loop through all the properties in the object for(var prop in person) { document.write("<p>" + prop + " = " + person[prop] + "</p>"); } </script> </body> </html>