<script> var a = [1,2,3] a.forEach(function () { arguments[2][arguments[1]] +=1 }) alert(a) </script>