constructor
2020-08-25 本文已影响0人
你坤儿姐
constructor
翻译:构造者、构造器
语法:object.constructor
<script type="text/javascript">
function employee(name,job,born){
this.name=name;
this.job=job;
this.born=born;
}
var bill= new employee("Bill Gates","Engineer",1985);
document.write(bill.constructor);
</script>
输出:
function employee(name,job,born){
this.name = name ;
this.job = job;
this.born = born;
}
模板字符串拼接
var name = `Your name is $(first) $(last).`