I have a number of objects created using the myObject = new Object(); syntax.
several of the objects have entire lists of similar properties.
myBox.cmwidth = 10; myCircle.cmwidth = 10; myTriangle.cmwidth = 10;
myBox.color = "blue"; myCircle.color = "blue"; myTriangle.color = "blue";
is there a way to create a class, function, or object parent/child that represents color = blue and cmwidth = 10?
I thought to use A extends B, but that appears to require both parent and child to be classes. Are objects and classes compatible?
you could create a myShape class that extends the object class and all class instances have cmwidth property = 10 and have a color property = "blue". then create a myBox class that extends the myShape class and a myCircle class that extends the myShape class etc.