Hey i dont know if that is possible but i want to set a given variable in js by reference.
What i want to do is, that each time i pass a string to t
You can clone the object by first converting it to JSON (watch out for circular references) and then parse it back again. Like so:
function clone(obj) {
return JSON.parse(JSON.stringify(obj));
}
This uses the internal browser's JSON routines (safer & faster than using an external resource). If you simply must have backwards compatibility you can download the core JSON routines from JSON.org.