KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a better way other than looping to find data in JSON ? It's for edit and delete. for(var k in objJsonResp) { if (objJsonResp[k].txtId == id) { if (action == 'delete') { objJsonResp.splice(k,1); } else { objJsonResp[k] = newVal; } break; } } The data is arranged as list of maps. Like: [ {id:value, pId:value, cId:value,...}, {id:value, pId:value, cId:value,...}, ... ]
Tags (comma-separated)
Save Edits
Cancel