A
A
Alecxandrys2017-03-04 11:47:45
JavaScript
Alecxandrys, 2017-03-04 11:47:45

Change tracking and what are the reasons for this behavior of the constructor?

Good afternoon,
There are 2 questions:
1) Is it possible to somehow track the moment when someone changes the document in Mongo and find out where the call comes from? It is not possible to set the source of the change and correct the changes made
2) What is the reason for this behavior of the constructor (the line under the breakpoint):
1240aca3e3d141b6ad9c6444c94ce22e.png
As you can see in the debug mode, despite the fact that options.index exists and equals 0, the default value -1 is stored in the object.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Manakov, 2017-03-04
@Alecxandrys

2) Because !!0 === true
You should use:
Or from ES6 instead of the top line (default params - something like that is called (and MB is not, I don’t remember))

function Element({ desk = 'deck0', index = -1, speed = 0, curATB = 0, canMove = false })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question