Bash array variables are changed in loop runtime

I am trying to check whether particular host and port are responding or not. I am using below script to check. but node_port array that i am using in loop is getting replaced with previous iteration value. Script and output is given.

Please help me to understanding why node_port values are replaced and how to avoid that.

I am using bash shell for executing this.

host_names=(xx.yy.zz.167 xx.yy.zz.168 xx.yy.zz.169 xx.yy.zz.170 xx.yy.zz.171 xx.yy.zz.172)
node_port=(2100 2200 2300 2400 2500)

while :
do
        LoopstartTime=$(date '+%Y-%m-%d %r %Z')
        unset i j
        for i in "${host_names[@]}"
        do
                echo "First Loop-$i"
                for j in "${node_port[@]}"
                do
                  echo "        Second Loop-$j"
                  echo "        variables list ${node_port[@]}"
                  echo "        no of arg ${#node_port[@]}"
                  unset j
                done
        done
        LoopendTime=$(date '+%Y-%m-%d %r %Z')
        echo "Process started at ${LoopstartTime} and Completed at ${LoopendTime}"
        echo " "
        sleep $wait_time
done

Output is

The output doesn't seem to belong to the script?
And, the node_port array is NOT altered by that script.

Hi Rudic, Thanks for quick response.

Output is from above script, I just modified IP address due to sensitivity of the data. when i executed above script thats what exactly printed on screen.

Please let me know if you have any questions.

Please DON'T edit posts after people commented on it, pulling the rug from under their feet!

Running that script gives the expected output, and none of the variables is modified. What is the error that you think you encounter?
And, where has the

from the original post#1 gone?

Sorry for that.

is removed as that is not relevant.
I am not encountering error but my array sequence is getting changed in run time.

if you observer output every time second loop is completed

node_port

variable are updated or sequence is changed.

Please go through ouput once. that has node_port array output.

I can't reproduce the output you posted when running the script you posted. Nor are the input arrays altered in any way.
The idiosyncrasies mentioned must come from some parts of the script NOT posted.