javascript - push to first free place in an Array -


what beautiful way of doing so?

var arr = [1,2,3,undefined, null,,null];

pushing 4 output:

[1,2,3,4,null,,null]

var ind = arr.join().split(',').indexof(''); if (ind !== -1)     arr[ind] = 4 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

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

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