I've got one peculiar problem while working on with javascript. I have a temporary variable where I had stored a value while loading the page. Then I had to perform some filtering of data for some events, so I had assigned it to another variable and performed the filter like this:
var myVar = tempVar;
myVar is a new variable and initially tempvar has two array elements. After filtering I will be assigning the value to myVar. The strange thing occurs now. While myVar value changes, automatically tempVar value also changes. Do anyone know why this happens? If so can you tell me how to assign the variable value to another variable and perform operation without changing the variable's value?
tempVar. How to do this exactly depends on the "type" of the value.