JavaScript-参数默认值
与解构赋值结合
function connect({host="127.0.0.1",username}){
console.log(host)
}
connect({
host:'hhhh',
username:'hhhh'
})
1
2
3
4
5
6
7
2
3
4
5
6
7
上次更新: 2024/08/14, 04:14:33
与解构赋值结合
function connect({host="127.0.0.1",username}){
console.log(host)
}
connect({
host:'hhhh',
username:'hhhh'
})