15.2.10 Copying primitive type variables With primitive type variables it is straightforward to copy and change values. Consider the following code var name = "ibrahim"; var name = "james"; Initially the memory looks as follows Memory Location Value name "Ibrahim" name James" Then if we execute the following lines name = name name = "fred"; the values in memory will be Memory Location Value name James" name "fred" What is happening is that when one variable is assigned the value of a second, a copy of the second variable's value is placed into the location in memory for the first — so a copy of the value "james" from name was copied into the location for name.