//优点:可以不依照顺序传参
/*
  不传参默认为空字符串,
*/
function fun ({x='',y='',k='',j=''} = {}){ console.log(x,y,k,j) } fun({x:1,y:2})

 

相关文章: