M8Test Help

union

val numbers1 = arrayOf(1, 2, 3, 4, 5) val numbers2 = listOf(3, 4, 5, 6, 7) // 查找两个数组的并集 val union = numbers1.union(numbers2) // 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] _console.log("两个数组的并集: ", union)
def numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"), 1, 2, 3, 4, 5)) def numbers2 = $iterables.listOf(3, 4, 5, 6, 7) // 查找两个数组的并集 def union = numbers1.union(numbers2) // 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] $console.log("两个数组的并集: ", union)
let numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Integer"), 1, 2, 3, 4, 5)) let numbers2 = $iterables.listOf(3, 4, 5, 6, 7) // 查找两个数组的并集 let union = numbers1.union(numbers2) // 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] $console.log("两个数组的并集: ", union)
local numbers1 = _objectWrappers:wrap(_arrays:arrayOf(_plugins:loadClass("java.lang.Integer"), 1, 2, 3, 4, 5)) local numbers2 = _iterables:listOf(3, 4, 5, 6, 7) -- 查找两个数组的并集 local union = numbers1:union(numbers2) -- 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] _console:log("两个数组的并集: ", union)
<?php $numbers1 = $objectWrappers->wrap($arrays->arrayOf($plugins->loadClass("java.lang.Long"), 1, 2, 3, 4, 5)); $numbers2 = $iterables->listOf(3, 4, 5, 6, 7); // 查找两个数组的并集 $union = $numbers1->union($numbers2); // 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] $console->log("两个数组的并集: ", $union);
numbers1 = _objectWrappers.wrap(_arrays.arrayOf(_plugins.loadClass("java.lang.Long"), 1, 2, 3, 4, 5)) numbers2 = _iterables.listOf(3, 4, 5, 6, 7) # 查找两个数组的并集 union = numbers1.union(numbers2) # 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] _console.log("两个数组的并集: ", union)
# encoding: utf-8 numbers1 = $objectWrappers.wrap($arrays.arrayOf($plugins.loadClass("java.lang.Long"), 1, 2, 3, 4, 5)) numbers2 = $iterables.listOf(3, 4, 5, 6, 7) # 查找两个数组的并集 union = numbers1.union(numbers2) # 输出:两个数组的并集: [1, 2, 3, 4, 5, 6, 7] $console.log("两个数组的并集: ", union)
Last modified: 29 April 2025