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

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 -