InsertWords()函数无意中修改了文本变量。如果变量text.text为"example TEST here",变量text.words为"TEST",InsertWords()函数会将text.text更改为"exampleˣhere“。我希望text变量保持不变,而只有textCopy变量发生变化。我该怎么做呢?为什么即使我从来没有在text.text上使用过regex.Replace,它也会发生变化?tex
例如,变量x是函数my的对象。我只想让函数my运行一段时间,但我不知道如何停止它。while (1) // means this process is an infinite loop console.log(1);}
var x = new my(); 在不修改函数my(因为原始函数非常复杂)的前提下,如何停止函数,或者如何删除对象?