一些JavaScript Quiz
时间:2010-10-16 来源:kang !
var condition = true, numb = 0; condition && alert('rain-man'); condition && (numb = 1 + 2);
prototype中的一些细节
var A = function(){ this.name = 'rain-man'; }; A.prototype = { name : 'cnblogs' }; var o = new A(); console.log(o.name); // 'rain-man'
var B = function(){}; B.prototype = { name : 'obj-B' }; var C = function(){}; C.prototype = new B(); var o = new C(); o.name = 'obj-c'; delete o.name; console.log(o.name); //'obj-B',暴漏原型链
相关阅读 更多 +