I'm currently trying to loop an array in a function. This function supposed to be used for a button, which gives every time a different value from the array when its pressed. 

```
var list=['DEFAULT','ADVANCED','DEVELOPMENT'];

```

Every time user clicks on the button i need the next value from the array. (when its "DEVELOPMENT", next should be "DEFAULT"). Is it possible to do it without using a global variable ?