Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js 2 varibale points on same values

// if you face a problem when you have tow varibales or objects pointing on the same values
//and when you change one of them the other one value changes you can solve it this way
// example :
var a = temp
var b = temp
//this will result on a and b having same refrence that make it mutable
var a = temp
var b = JSON.parse(JSON.stringify(temmp))
/*this should solve it */(●'◡'●)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #varibale #points #values
ADD COMMENT
Topic
Name
4+4 =