Provided this code
let myVar = 'hey'
let myVar2 = myVar
myVar = 'what'
When I assign let myVar2 = myVar, I am assigning a reference to myVar2? Or in the assignation myVar gets resolved and I am assigning the value that myVar has at that moment?
My doubt is whether
- myVar2holds a reference towards the original- myVar(which is no longer available since it has been overwritten by the second assignation- myVar = 'what')
- or myVar2holds since the beginning whatever value hadmyVar, regardless that that variable will be overwritten later on
