var theThing = null; function replaceThing() { theThing = { longStr: Array(1E6).join("*"), someMethod: function() { } }; } setInterval(replaceThing, 1E3);