1構造函數函數
function Student(name) { this.name = name; this.hello = function () { alert('Hello, ' + this.name + '!'); } } //調用 var xiaoming = new Student('小明'); xiaoming.name; // '小明' xiaoming.hello();