Garmaine Staff asked 2 years ago
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 5 hours ago.

Say I have something like the following:

const foo = {
  x: 0,
  y: 0,
  bar: () => {
    return foo.x;


But calling bar from foo will only return me the initial values that are set not the value if I update the object. Any suggestions?