There is an array:
var list = [{ status:0, id:1, img:"/assets/images/user-avatar-cropped.png", value:110, result:1 },{ status:0, id:2, img:"/assets/images/user-avatar-cropped.png", value:120, result:1 }, { status:0, id:3, img:"/assets/images/user-avatar-cropped.png", value:130, result:1 }, { status:0, id:4, img:"/assets/images/user-avatar-cropped.png", value:140, result:1 },] The array needs to be updated, for example. You need to change the object in which the value id = 1, and set it to status = 2, and result = 0.
I understand about logic that you first need to remove this object from the array, and then re-start with new (necessary) values.
- How to remove an object from an array with a corresponding id (for example, delete an object where id = 1)?
- Is it possible to somehow simply update an object (without deleting it and then adding it). Well, or is there any other solutions to this problem.