Seperti yang dijelaskan oleh @mplungjan, saya pikir itu benar. Lalu langsung saya klik tombol up rate. Tapi dengan mengikutinya, akhirnya saya mendapat error.
<script>
var data = {"result":[
{"FirstName":"Test1","LastName":"User","Email":"test@test.com","City":"ahmedabad","State":"sk","Country":"canada","Status":"False","iUserID":"23"},
{"FirstName":"user","LastName":"user","Email":"u@u.com","City":"ahmedabad","State":"Gujarat","Country":"India","Status":"True","iUserID":"41"},
{"FirstName":"Ropbert","LastName":"Jones","Email":"Robert@gmail.com","City":"NewYork","State":"gfg","Country":"fgdfgdfg","Status":"True","iUserID":"48"},
{"FirstName":"hitesh","LastName":"prajapti","Email":"h.prajapati@zzz.com","City":"","State":"","Country":"","Status":"True","iUserID":"78"}
]
}
alert(data.result)
delete data.result[3]
alert(data.result)
</script>
Hapus hanya menghapus data, tetapi 'tempat' masih ada karena belum ditentukan .
Saya melakukan ini dan itu bekerja seperti pesona:
data.result.splice(2,1);
artinya: hapus 1 item pada posisi 3 (karena array dihitung dari bentuk 0, maka item di no 3 dihitung sebagai no 2)