日期:2014-05-16 浏览次数:20344 次
<script> function foo(){ foo.abc = function(){alert('def')} this.abc = function(){alert('xyz')} abc = function(){alert('@@@@@')}; var abc = function(){alert('$$$$$$')} } foo.prototype.abc = function(){alert('456');} foo.abc = function(){alert('123');} var f = new foo(); f.abc(); foo.abc(); abc(); </script>
var f = new foo(); f.abc(); // alert('xyz'); foo.abc(); // alert('def'); abc(); // alert('@@@@@');