M
M
Mikhailo Poberezhny2016-06-04 22:49:59
JavaScript
Mikhailo Poberezhny, 2016-06-04 22:49:59

Problem with async?

var cache = {
        order: null
}
cache.order = order; // тут order.status = "progress"
// мне надо присвоить в cache.order полностью объект  order но оно успевает присвоить статусу значение open
// как дождаться пока оно присвоит а потом менять значения?
order.invitedPerformers = order.invitedPerformersCache;
order.performer = null;
order.status = "open";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Grabko, 2016-06-04
@VGrabko

Cloning the object completely will not work. All variables will store references to the object. You can clone an object using a loop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question