Working with local storage loop

Loop writes duplicate entries for the same key/value each time I hit
display or view.