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;
}
}
console.log(foo.bar());
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?
Please login or Register to submit your answer