<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="./jquery.js"></script>
<script>
var colors1 = ['red', 'green', 'blue'];
var colors2 = ['black', 'white', 'purple'];
var colors3 = ['yellow', 'pink', 'orange'];
// 将第二数组合并到第一个数组中,该方法只能合并 2 个数组
// console.log($.merge(colors1, colors2, colors3))
console.log(colors1.concat(colors2, colors3))
</script>
</body>
</html>
jQuery-工具方法-merge方法
最新推荐文章于 2021-09-13 15:24:06 发布