0

getting no result! when I am typing document.write('hello world') in html script or in other file, I didn't get any output.

function person(name, age, color) { this.name = name; this.age = age; this.favColor = color; } var p1 = new person("John", 42, "green"); var p2 = new person("Amy", 21, "red"); document.write(p1.age); document.write(p2.name); these upper mentioned statements are not working even in the solo learn compiler.

19th Apr 2020, 11:20 AM
Omraj Sharma
Omraj Sharma - avatar
2 Answers
+ 2
The code works as expectd for me. You did put the code in JS tab right? Output 42Amy on screen.
19th Apr 2020, 11:31 AM
Ipang
+ 1
Thank you for your concern. Issue is resolved now. Thank you
19th Apr 2020, 11:38 AM
Omraj Sharma
Omraj Sharma - avatar