|
|
MessyBlob wrote:
> "clipka" <nomail@nomail> wrote:
>> Yuck. We all know this sucks.
>
> Doesn't JavaScript have the ability to assign properties to objects as they are
> being instantiated?, e.g.
>
> Sph = new Sphere( {
> radius: 1,
> position: [0,0,1]
> } );
>
> I'm not sure about assigning 'new objects as properties' within these
> properties, e.g. creating a new material in the Sphere new object. Can anyone
> clarify this?
>
I've never come across this particular syntax. What is more common is to
do something like this:
Sph = new Sphere();
Sph.radius = 1;
Sph.position = [0,0,1];
-Mike
Post a reply to this message
|
|