# Unwanted circular update of variables

**URL:** <https://discourse.nodered.org/t/unwanted-circular-update-of-variables/71126>\
**Category:** General\
**Created:** [23 November 2022 16:05 UTC](https://discourse.nodered.org/t/unwanted-circular-update-of-variables/71126 "2022-11-23T16:05:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 November 2022 16:18 UTC](https://discourse.nodered.org/t/unwanted-circular-update-of-variables/71126/2 "2022-11-23T16:18:16Z")

</div>

This comes up regularly, most recently a few hours ago. A lot can be learned by watching the forum and trying to at least read all the questions, and following any threads that look interesting.

> [@Issues with variables](https://discourse.nodered.org/t/issues-with-variables/71121):
>
> Hello everyone, I'm having some problem with basic variables manipulations. Here's a code example that does the issue. let CopyOfOriginal = context.get('CopyOfOriginal') || []; let OriginalObject = { payload:'Im original' } CopyOfOriginal.push(OriginalObject); context.set('CopyOfOriginal', CopyOfOriginal); // Modify after the context.set OriginalObject.payload = 'Im modified'; // Push without context.set CopyOfOriginal.push(OriginalObject); return msg; I'm expecting the CopyOfOrigi…

---

_[View the full topic](https://discourse.nodered.org/t/unwanted-circular-update-of-variables/71126)._
