# A pointer or a copy

**URL:** <https://forum.makecode.com/t/a-pointer-or-a-copy/4306>\
**Category:** Help\
**Created:** [November 6, 2020, 5:04pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306 "2020-11-06T17:04:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [November 6, 2020, 5:04pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/1 "2020-11-06T17:04:22Z")

</div>

If I do this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/1c67243adff85990e6d57328a6d9b9e6d0f7b2f1.png)  
Will `user_artifacts_copy` be a pointer to `user_artifacts` or a copy of it? (`user_artifacts` is a list of a list of strings if that is relevant)

---

<div class="post-metadata">

**Author:** ![livcheerful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/livcheerful/32/3509_2.png) [@livcheerful](https://forum.makecode.com/u/livcheerful)\
**Post date:** [November 6, 2020, 5:30pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/2 "2020-11-06T17:30:57Z")

</div>

hihi I did a test and I believe it’s just a pointer (/ shallow copy)

This was my test:

> **[Copy](https://arcade.makecode.com/44739-85692-32883-81230)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I only changed one of the arrays but both of them printed out the same thing

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [November 6, 2020, 5:35pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/3 "2020-11-06T17:35:10Z")

</div>

I agree.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [November 6, 2020, 5:36pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/4 "2020-11-06T17:36:45Z")

</div>

Thank you! That’s why it wasn’t working…

Is there a block for a deep copy? Or will I have to do something like this:

```auto
# Python, since I don't know TypeScript well enough
user_artifacts_copy = []
for element in user_artifacts:
    user_artifacts_copy.append(element)

```

---

<div class="post-metadata">

**Author:** ![livcheerful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/livcheerful/32/3509_2.png) [@livcheerful](https://forum.makecode.com/u/livcheerful)\
**Post date:** [November 6, 2020, 5:51pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/5 "2020-11-06T17:51:31Z")

</div>

hmmmmm I think you’ll have to implement your own copy \>\>

I should add this to joey’s util extension!

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [November 6, 2020, 5:55pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/6 "2020-11-06T17:55:11Z")

</div>

> [@livcheerful](#):
>
> I should add this to joey’s util extension!

Do you know where is the link to the Github repo? You are always using it on streams but I never remember the URL. 😅

---

<div class="post-metadata">

**Author:** ![livcheerful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/livcheerful/32/3509_2.png) [@livcheerful](https://forum.makecode.com/u/livcheerful)\
**Post date:** [November 6, 2020, 6:13pm UTC](https://forum.makecode.com/t/a-pointer-or-a-copy/4306/7 "2020-11-06T18:13:36Z")

</div>

ahahaha you’re not alone. I thought I could find it by guessing but I ended needing to scroll through our chat to find it XD

here it is!

> **[jwunderl/arcade-sprite-util](https://github.com/jwunderl/arcade-sprite-util)**
>
> A few utility functions for sprites. Contribute to jwunderl/arcade-sprite-util development by creating an account on GitHub.
