plus
val numbers1 = arrayOf(1, 2, 3)
val numbers2 = mutableListOf(4, 5, 6)
// 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1.plus(numbers2).forEach {
_console.log(it)
}
def numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"), 1, 2, 3))
def numbers2 = $iterables.mutableListOf(4, 5, 6)
// 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1.plus(numbers2).forEach {
$console.log(it)
}
let numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"), 1, 2, 3))
let numbers2 = $iterables.mutableListOf(4, 5, 6)
// 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1.plus(numbers2).forEach((it) => {
$console.log(it)
})
local numbers1 = _objectWrappers:wrap(_arrays:arrayOf(_plugins:loadClass("java.lang.Integer"), 1, 2, 3))
local numbers2 = _iterables:mutableListOf(4, 5, 6)
-- 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1:plus(numbers2):forEach(function(it)
_console:log(it)
end)
<?php
$numbers1 = $objectWrappers->wrap($arrays->arrayOf($plugins->loadClass("java.lang.Long"), 1, 2, 3));
$numbers2 = $iterables->mutableListOf(4, 5, 6);
// 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
$numbers1->plus($numbers2)->forEach(function ($it) use ($console) {
$console->log($it);
});
numbers1 = _objectWrappers.wrap(_arrays.arrayOf(_plugins.loadClass("java.lang.Long"), 1, 2, 3))
numbers2 = _iterables.mutableListOf(4, 5, 6)
# 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1.plus(numbers2).forEach(lambda it: _console.log(it))
# encoding: utf-8
numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Long"), 1, 2, 3))
numbers2 = $iterables.mutableListOf(4, 5, 6)
# 将两个数组合并成一个新数组,合并后的数组: [1, 2, 3, 4, 5, 6]
numbers1.plus(numbers2).forEach { |it|
$console.log(it)
}
Last modified: 09 September 2025