I have found this so useful, and have come back to this resource numerous times.
It is much more efficient than looping through every element.
I'm putting this minified code here for future reference, also because INSERT is 0.0006 milliseconds faster and REMOVE is 0.0012 milliseconds faster, that's right, faster than 12Me21
'INSERT AN ITEM INTO AN ARRAY DEF INSERT A[],I%,V UNSHIFT A,V COPY A,A,1,I% A[I%]=V END 'REMOVE AN ELEMENT FROM AN ARRAY DEF REMOVE A[],I% COPY A,I%,A,I%+1,LEN(A)-I%-1 I%=POP(A) END