title: Creating copies in Julia with = operator
body: <p>When I create some array A and assign it to B</p>
  
  <pre><code>A = [1:10]
  B = A
  </code></pre>
  
  <p>I can modify A and the change reflects in B</p>
  
  <pre><code>A[1] = 42
  # B[1] is now 42
  </code></pre>
  
  <p>But if I do that with scalar variables, the change doesn't propagate:</p>
  
  <pre><code>a = 1
  b = a
  a = 2
  # b remains being 1
  </code></pre>
  
  <p>I can even mix the things up and transform the vector to a scalar, and the change doesn't propagate:</p>
  
  <pre><code>A = [1:10]
  B = A
  A = 0
  # B remains being 1,2,...,10
  </code></pre>
  
  <p>What exactly does the <code>=</code> operator does? When I want to copy variables and modify the old ones preserving the integrity of the new variables, when should I use <code>b = copy(a)</code> over just <code>b=a</code>?</p>