import Foundation println("Hello, World!") var arr = [1, 2, 3, 4] var arr1 = arr // share the same elements and do not copy really arr1.unshare() // really to copy at the time when call unshare method println(arr1) arr1[0] = 10 println(arr) println(arr1) arr[0] = 20 println(arr) // only one exists, so it is unshare automatically. println(arr1)