var Book = function (id, price, bookname) {
// 私有属性
var num = 1
// 私有方法
function checkId () {
}
// 特权方法
this.getName = function () {}
this.getPrice = function () {}
this.setName = function () {}
this.setPrice = function () {}
// 对象公有属性
this.id = id
this.price = price
this.bookname = bookname
// 对象公有方法
this.copn = function () {
}
// 构造器
this.setName(name)
this.setPrice(price)
}
var eng = new Book(1, 12, 'english')
欢迎关注:http://www.w3schools.top/ 学习您想要的一切IT教程!