javascript中constructor
<script>
function Foo(){this.id ="01";}
function Person() {this.name = "zhangjing"}
var foo = new Foo
alert(foo.constructor)
Foo.prototype.constructor=Person
alert(foo.constructor)// foo.constructor是function Person() {this.name = "zhangjing"}
//但是new出fo还是Foo对象
var fo = new Foo
alert(fo.constructor)
alert(fo.name)
</script>