Thursday 30 April 2020

How to change value of object attribute which is inside an array using JavaScript

state = { todos:[ {id:1, title: 'Eat breakfast', completed: false}, {id:2, title: 'Make bed', completed: false} ] }; if my id==-3 then update title = 'dinner' if my id != 3 then don't updatehow can i do this?

Submitted April 30, 2020 at 10:51AM by mtkxvx

No comments:

Post a Comment