JavaScript lesson learnt: Don’t trust console.log(object);
Doing my first angular app. Got stuck with a problem that my naive trust of “console.log(object);” leading me to the wrong direction of debugging.
“console.log(object);” only prints the object at the latest state of execution. Not at the state the line is been executed.
Use below code instead!
console.log(JSON.stringify(object));