标签:pre rest OLE const mes 运算符 针对 username cti
1. 输出
function connect({host,port,userName,password}){
console.log(host)
console.log(port)
console.log(userName)
console.log(password)
}
connect({
host: ‘127.0.0.1‘,
port: ‘8080‘,
userName: ‘root‘,
password: ‘1234567‘
})
// 127.0.0.1
// 8080
// root
// 1234567
2. 输出
function connect({host,port,...user}){
console.log(host)
console.log(port)
console.log(user)
}
connect({
host: ‘127.0.0.1‘,
port: ‘8080‘,
userName: ‘root‘,
password: ‘1234567‘
})
// 127.0.0.1
// 8080
// {userName: "root", password: "1234567"}
3. 输出
const skillOne = {q:‘java‘}
const skillTwo = {w:‘php‘}
const skillThree = {e:‘vue‘}
const skillFour = {r:‘javascript‘}
const message = {...skillOne, ...skillTwo, ...skillThree, ...skillFour}
console.log(message); //{q: "java", w: "php", e: "vue", r: "javascript"}
标签:pre rest OLE const mes 运算符 针对 username cti
原文地址:https://www.cnblogs.com/wangRong-smile/p/14041901.html