N
N
Nikita2016-12-09 02:27:53
JavaScript
Nikita, 2016-12-09 02:27:53

Object properties disappear, how is this possible?

I met a very strange behavior of an object that is passed through next()y Rx.Subject()from RxJs.

rxSubject.subscribe({
            next: (state) => {
                console.log(state);
                console.log(JSON.stringify(state));
            },
        });

972c1e53db6c4500872b9c4eb32a83c2.PNG
The problem is that with any access to internal objects, they are empty, and in debugging, the root object says that its childs are full of data.
I don’t know if it’s important which library is used to transfer the object, but who can explain to me how, in principle, this is possible?
UDP: The order of execution of these two expressions does not matter, if 10 such pairs are used in a row, they all produce the same result.
PS: The problem was not solved in any way, changing the browser does not help, so I do not know any special properties of Javascript, what is it? Explain, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Wolf, 2016-12-09
@bitver

at the moment when you output data to the console, the object is empty. At the moment when you open it in the console, it is already full.

Z
Zakharov Alexander, 2016-12-09
@AlexZaharow

What if it's the other way around?

rxSubject.subscribe({
            next: (state) => {
                console.log(JSON.stringify(state));
                console.log(state);
            },
        });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question