# Share data ( variable, array) between two canvas

**URL:** <https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434>\
**Category:** Beginners\
**Created:** [December 5, 2024, 8:09pm UTC](https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434 "2024-12-05T20:09:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edufissure](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@edufissure](https://discourse.processing.org/u/edufissure)\
**Post date:** [December 5, 2024, 8:09pm UTC](https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434/1 "2024-12-05T20:09:52Z")

</div>

Hi ive been googleing, but im asking if there is any trick or way to share info, for example object, variables, arrays between two sketches.

Lets say i have one game in one canvas inside a div id=“game”… but in other place of my html file i want to put or write some kind of scoreboard, showing the score and time and lifes left… So is there any “global” variable that i can use ? To interchange data

Or when game is finish, in the scoreboard place i want to show a message Game Over  
Thanks

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 5, 2024, 9:33pm UTC](https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434/2 "2024-12-05T21:33:59Z")

</div>

> [@edufissure](#):
>
> So is there any “global” variable that i can use to interchange data?

> **[globalThis - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis)**
>
> The globalThis global property contains the global this value, which is usually akin to the global object.
