1

I got a little problem.

m1 = new Matrix3D(null);

m1.initRotX(20);

console.log(m1);

m1.initRotY(20);

console.log(m1);

this is logging 2 times the same matrix.(the y rot Matrix) when i initialize a new matrix every time it works fine.

Is js threading this and the init function is faster the the log or is there another explenation for this?

1 Answers1

1

If you log an object to the console, you will see two things: one row (usually printed in italics), which shows the result of the object's toString() method at the moment when you called console.log(). The second row, which you can expand to view the detailed properties of the object, always shows the latest state of the object, no matter at what point the log was made.

Máté Safranka
  • 4,081
  • 1
  • 10
  • 22