var firstArray=[5,5,3,5,8,5,9,5,4,5,9,5]; for(var i=0;i<=firstArray.length;i++){ if(firstArray.indexOf(5)!=-1){ firstArray.splice(firstArray.indexOf(5),1); } } gs.info(firstArray);
Remove Specific item which occurs number of times in an Array
Working Code Asked question May 2, 2024