1.2.2.6.預設值
設定function預設值的方法:
function greet(name) {
name = name || '<Your name here>';
console.log('Hello ' + name);
}
greet('Tony');
greet();
Last updated
Was this helpful?
設定function預設值的方法:
function greet(name) {
name = name || '<Your name here>';
console.log('Hello ' + name);
}
greet('Tony');
greet();
Last updated
Was this helpful?