默认参数,方法的默认值 function test (a:string, b:string, c:string="jojo"){//declare in the last
console.log(a);
console.log(b);
}
console.log(a);
console.log(b);
}
2017-11-06
字符串特性:
多行字符串·· 撇号
字符串模板:${}
自动拆分字符串function test(template, name, age) {
console.log(template);
console.log(name);
console.log(age);
}
let myname: string = "qiubo";
let age = 18;
test`my name is ${myname}, I'm ${age}`
多行字符串·· 撇号
字符串模板:${}
自动拆分字符串function test(template, name, age) {
console.log(template);
console.log(name);
console.log(age);
}
let myname: string = "qiubo";
let age = 18;
test`my name is ${myname}, I'm ${age}`
2017-11-06