D
D
DeFaNJI2022-03-14 21:31:06
JavaScript
DeFaNJI, 2022-03-14 21:31:06

Why do object keys get mixed up?

I created two objects

const obj1 = {
     userId: 2
}
const obj2 = {
      userId: 1
}


Created two recursive timeouts for these two objects, these are different functions. And then I go through for in on the keys of the object. But sometimes the key from obj1 gets into the function that checks obj2, why is this happening?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question