# Global Context being updated when no global.set executed

**URL:** <https://discourse.nodered.org/t/global-context-being-updated-when-no-global-set-executed/71378>\
**Category:** General\
**Tags:** function-node\
**Created:** [28 November 2022 14:29 UTC](https://discourse.nodered.org/t/global-context-being-updated-when-no-global-set-executed/71378 "2022-11-28T14:29:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 November 2022 14:51 UTC](https://discourse.nodered.org/t/global-context-being-updated-when-no-global-set-executed/71378/3 "2022-11-28T14:51:20Z")

</div>

Hi @Tilerdon

You are hitting a side effect of how JavaScript passes variables around by reference, rather than value.

This recent post explains it in more detail and how to avoid it: [Issues with variables - #2 by TotallyInformation](https://discourse.nodered.org/t/issues-with-variables/71121/2)

---

_[View the full topic](https://discourse.nodered.org/t/global-context-being-updated-when-no-global-set-executed/71378)._
