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.
2 Respostas
+ 2
The code works as expectd for me. You did put the code in JS tab right?
Output 42Amy on screen.
+ 1
Thank you for your concern. Issue is resolved now. Thank you