0

I have an object that is displaying different attributes than what is being passed and I have no idea why this is happening.

enter image description here

The object is created when the script is first run and as I return objects from the database I return the updated object. When I am evaluating the properties of the object they do not match with what is being passed into my function, once I expand the object I see the property that matches with what was passed in but when I am reading it, it is completely different!

Has anyone else encountered this before?

https://i.stack.imgur.com/zdqtO.png

user3183411
  • 315
  • 2
  • 7
  • 19
  • 2
    My guess is that you return the object *before* updating it from the database. – Bergi Nov 21 '17 at 15:38
  • Can you take a snippet of your code? – Oren Shamun Nov 21 '17 at 15:42
  • 1
    Bergi was right. The object was being returned well before it was being updated. I was using forEach loops to evaluate the data. I modified it to use a for loop and adding in a variable to keep track of the count. I don't know why I didn't think of that sooner. – user3183411 Nov 21 '17 at 19:09

0 Answers0