//类 函数
// function Star(name){
// this.name = name
// this.life = 0
// }
// Star.prototype.kind = 'star'
// Star.prototype.show = function(){
// console.log(this.name+'会发光');
// }
// var moon = new Star('moon')
// moon.show()
// class
class Star{
static num = 1// 子类看不到
#color = 'white' // 子类不能使用
constructor(name){
this.name = name
this.life = 0
}
show(){
console.log(this.name+'会发光');
this.#color = 'blue'
}
}
var moon = new Star('moon')
moon.show()