javascript - how to prevent the overwriting in arrays -


i thinking short out problem of global variable. thinking method messing connect chains of question want function prevents 1 overwrite on present index of array

window.abc[0] = "first"; 

now after writing many lines of code mistakably write same code different value such as:

window.abc[0] = "second"; 

then function should come , put second on index 1 second should put in window.abc[1].

thanks.

if use "push" method array index automatically increase :)

kevin


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -