Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript copy by reference

// copy by reference 
var arr = [1,2,3,4]
// both point to same array
var arr2 = arr

// object
var obj = {
	"name" : "Himanshu"
}
// both point to the same object
var newObj = obj
 
PREVIOUS NEXT
Tagged: #javascript #copy #reference
ADD COMMENT
Topic
Name
1+2 =