Insert/Remove from arrays in dataset

Sorry.

I have two array fields in the dataset. One is populated and one is empty.

How do I take a value from the first array field and programmatically move it to the other array field?

ex:

let array1 = results.item[x].active;
let value = array1[2]; //27
???

How can I programmatically move 27 from the “active” array field to the “used” array field?