]
鯘聱gnaIf you need to introduce external Js, you need to refresh to execute <script>
function Employee(name, age, title, salary)//括号里的东东是参数,还是属性?如何遍历?
{
this.name = name;
this.age = age;
this.title = title;
this.salary = salary;
this.promotion = promotion;
}
function promotion(new_title,percent_raise)
{
var salary_increase = this.salary * percent_raise;
this.salary = this.salary + salary_increase;
this.title = new_title;
}
function newdx(){
var aq=new Employee("aq",22,"qigai",3000)
alert(aq.name+"的职业是"+aq.title+",薪水是"+aq.salary)
aq.promotion("bangzhu",1)
alert(aq.name+"的新职业是"+aq.title+",薪水是"+aq.salary)
}
newdx()
</script>]<script>
function hutia(){
for(var i=0;i<arguments.length;i++)document.write(arguments[i]+",");
document.write("
");
}
hutia(1,2,3,4);
hutia("haha","hehe", true, false);
hutia("Show me the money", "Operation cwal", "Food for thought", "the gathering");
</script>