---
title: "Discussion on \"Copying an array variable to another variable\" | Hashnode"
description: "Discussion on \"Copying an array variable to another variable\". A common mistake newbies in JavaScript make, is referencing arrays instead of copying it when using the assignment operator.\nlet pokemons = ['pikachu', 'eevee', 'snorlax', 'charmander', 'charizad'];\n\n// This will point (create a reference) new_pokemo..."
url: "https://hashnode.com/posts/copying-an-array-variable-to-another-variable/6160612cb945c81a907d0803"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Copying an array variable to another variable](https://anjanesh.dev/copying-an-array-variable-to-another-variable?utm_source=hashnode&utm_medium=feed)

A common mistake newbies in JavaScript make, is referencing arrays instead of copying it when using the assignment operator. let pokemons = \['pikachu', 'eevee', 'snorlax', 'charmander', 'charizad'\]; // This will point (create a reference) new\_pokemo...

Oct 8, 2021 · 1 min read · anjanesh.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#arrays](https://hashnode.com/tag/arrays)

## Written by

[Anjanesh Lekshminarayanan](https://hashnode.com/@anjanesh)

@anjanesh · Navi Mumbai, MH

  
[View profile](https://hashnode.com/@anjanesh)

Web UI Engineer

I am a web consultant from Navi Mumbai. Mainly dealt with LAMP stack, now into Django and getting into Laravel and Cloud. Founder of nerul.in and gaali.in

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
