function Phone (brand,price) {
this.brand = brand
this.price = price
}
Phone.prototype.call = function () {
console.log('我可以打电话')
}
Phone.name = 'hahaha'
Phone.todo = function (){
console.log('666')
}
Phone.prototype.size = '5.5inch'
let Huawei = new Phone('华为',5999)
console.log(Huawei)
class phone{
static name = '手机'
static change () {
console.log('我可以改变世界')
}
constructor (brand,price){
this.brand = brand
this.price = price
}
call () {
console.log('我可以打电话')
}
callname () {
console.log(this.name)
}
}
let onePlus = new phone("1+",5965)
console.log(onePlus)
console.log(onePlus.name)
console.log(phone.name)
console