Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var txt = ""; var person = {fname:"John", lname:"Doe", age:25}; var x; for (x in person) {txt += person[x] + " ";} document.getElementById("demo").innerHTML = txt; </script> </body> </html>