1.重新修改值:
function Base( name, age ) {
this.name = name;
this.age = age;
this.job = "soft";
}
function Sub(name, age ,job) {
Base.call(this,name , age);
//this.name =
this.job = job;
}
var s = new Sub("zhang",23,"soft-engneering");
alert(s.job);
//本质上面就是修改一下属性值而已
2.生成颜色
function getColor(r, g, b , a) {
return "RGB("+r+","+g+","+b+","+a+")";
}
var color = getColor(12,34,89);
alert(color);
疑问解决代码小记录
最新推荐文章于 2023-12-05 14:57:55 发布