I state that I have tried for a long time before writing this post.
For an InDesign script, I\'m working with two array of ListItems. Now I\'m trying to remove the items
arr_A = ["a","b","d","f","g"]; arr_B = ["a","c","f","h"]; var newArr = []; var item while ( item = arr_B.shift() ) { arr_A.contains ( item ) && newArr[ newArr.length ] = item ; } newArr;// ["a", "f"];