作者:猛儿187888 | 来源:互联网 | 2023-05-19 06:11
Let's suppose that we have arrays x = ['a', 'b', 'c']
and y
. Is there an easy way to move, say, the second element of x
, to y
? So that in the end, x
is ['a', 'c']
and y
is ['b']
.
假设我们有数组x = ['a','b','c']和y。有没有一种简单的方法可以将x的第二个元素移动到y?所以最后,x是['a','c'],y是['b']。
4 个解决方案