kullanmayı deneyin.
var event_id = [{"0":"e1"}, {"0":"e2"}, {"0":"e4"}];
event_id.push({"0":"e5"});
//event_id.splice(event_id.length, 0, {"0":"e5"}); // Same as above.
//event_id[event_id.length] = {"0":"e5"}; // Also the same.
event_id; // => [{"0":"e1"}, {"0":"e2"}, {"0":"e4"}, {"0":"e5"}];
dizilerinde mevcut yöntemler ve özelliklerin iyi bir referans için mükemmel
MDN documentation for the Array
object bakınız.
dizinin orta içine bir şey koymak için [Düzenle] o zaman kesinlikle herhangi bir konumda silme ve ekleme keyfi elemanları hem kolları splice(index, numToDelete, el1, el2, ..., eln)
yöntemi kullanmak isteyeceksiniz:
var a = ['a', 'b', 'e'];
a.splice(2, // At index 2 (where the 'e' is),
0, // delete zero elements,
'c', // and insert the element 'c',
'd'); // and the element 'd'.
a; // => ['a', 'b', 'c', 'd', 'e']
: http://stackoverflow.com/a/12189963/984780 –