For loop inside script

hi,
i want to iterate array values and store it in another value.
how to do that.

Sorry, it is not clear data from which component you need to access with script?