疑问解决代码小记录

来源:互联网 发布:qq代理公布软件 编辑:程序博客网 时间:2024/06/07 10:37

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);