标签:on() ons his new pre sha obj instance let
var singleton = (function(){ var instance; return function () { if (instance) return instance; instance = this; return instance; } }()); var obj = new singleton(); var obj2 = new singleton(); console.log(obj2 === obj); // true
标签:on() ons his new pre sha obj instance let
原文地址:http://www.cnblogs.com/ax-null/p/6789316.html