How to delete one element from the JSON Array

Today I founded , ‘how to delete one particular element from the JSON Array Object by specifying its index’ .

var mycomments = {'comments': [ { 'title':'one','description':'This is first comment','commentby':'arulalan'},{'title':'two','description':'This is second comment','commentby':'shrini'},{'title':'three','description':'This is thrid comment','commentby':'suresh'},{'title':'four','description':'This is fourth comment','commentby':'thayub'}, {'title':'five','description':'This is fivth comment','commentby':'baskar'},{'title':'six','description':'This is sixth comment','commentby':'ranjith'},{'title':'seven','description':'This is seventh comment','commentby':'niranjan'},{'title':'eight','description':'This is eighth comment','commentby':'antano'},{'title':'nine','description':'This is nineth comment','commentby':'solar'},{'title':'ten','description':'This is tenth comment','commentby':'john'} ] } ;

// now we are going to remove the 5 th element from our 'mycomments' json object by using "splice" in Java Script.


// array.splice( index, 1); is the syntax to remove one particular element from the array in js.



About arulalant

Currently working as "Project Scientist – C" in National Centre for Medium Range Weather Forecasting (NCMRWF), MoES, Noida, India
This entry was posted in Web. Bookmark the permalink.

3 Responses to How to delete one element from the JSON Array

  1. luislugo says:

    Thank you, this was really helpfull


  2. Pingback: 2010 in review of my blog from WP team :-) WoW | Tux Coder

  3. Pingback: Iphone Ipad Blog » Can I Retrieve Deleted Photos From My iPhone? – Get Your Lost iPhone Pictures Back!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s