JS面向對象編程?
function A(name){this.name = name;this.sayHello = function(){alert(this.name+” say Hello!”);};} function B(name,id){this.temp = A;this.temp(name); //相當于new A();delete this.temp; this.id = id; this.checkId = function(ID){alert(this.id==ID)};}