0
why color not execute when I type document.write ( p1.color) but age will be executed
4 Respostas
+ 9
because you have saved the property name as favColor and you are accessing it as color,
try
p1.favColor
+ 6
Can you show your code to us so we can see what is the problem.
+ 1
You can either replace p1.color with p1.favColor
Or you can change the property favColor to color.