ES6解构代替concat数组拼接

<!DOCTYPE html>    
<html lang="en">    
<head>    
    <meta charset="UTF-8">    
    <title>ES6解构代替concat数组拼接</title>  
</head>    
<body>  
<script type="text/javascript">
let a = [1, 2, 3]
let b = [4, 5]
let c = [...a, ...b]
console.log(c)
</script>      
</body>    
</html>

 

posted @ 2019-03-20 15:50  徐同保  阅读(847)  评论(0编辑  收藏  举报