Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,以下代码是否合法?
function RandomObject() { this.method = function () { return new RandomObject(); }; }
是的,没关系。只要确保你没有把它放在构造函数中,否则你会得到一个无限循环!