How can I remove userid 2 from the following array using javascript
{"maxPages":2,"data":[{"UserId":"1","UserName":peterparker,"}{"UserId":"2","UserName":spiderman,"}]}
I was thinking of first getting the index like: id = 2 row = myarray.data.UserId.indexOf(id)
Then remove the row based on the index
deleteon array elements. Besides, is there not multiple syntax errors with this declaration?deletewith arrays. Usedeletewith objects, and usesplice()with arrays (or generate a new array)..lengthby1.