Answer the question
In order to leave comments, you need to log in
Typescript mysticism or why is this nonsense happening?
I do the calculation using 30 functions.
I want to debug it at a certain step, but on any of the functions in the chain of sequences I get the same result.
Conditional example:
firstFunc(Parabola): object {
var sum = Parabola.a+Parabola.b;
var obj = {a: sum}
console.log(obj)
return obj;
}
secondFunc(Parabola):object {
var firstResult = this.firsnFunc(Parabola);
firstResult['newElement'] = 1;
}
final(Parabola) {
return this.secondFunc(Parabola);
}
final(Parabola);
Answer the question
In order to leave comments, you need to log in
In the browser console, in addition to displaying the result of obj.toString(), you get a reference to the object and can see its current state. But you are watching the console after the second function has been executed. Put a breakpoint in the right place and you will see the value at the moment of executing a particular line.
In order to output values to the console at the time of calling console.log, you must either display the values of specific object properties (unless, of course, these are objects that you mutate in the future), or display values in a new object (again, only if the properties are primitive values):
either convert target object in JSON string:
console.log(JSON.stringify(obj));
console.log(JSON.stringify(obj, null, ' ')); // красивый вывод с отступами
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question