![]() By using object of spread syntax, we update only the property name. In this case, we use a conditional block to update only the item that have an ID equal to three. Map creates a new array with the content return it by the cover function. Map iterates over the array and by using a callback function allow access to the items. ![]() There are immutable ways to do the same goal, like the map of function. One method to update the content of the array objects is accessing the elements of it by the array index, but this is a mutable method. To do this, we will use this little handy function that creates random user objects. Matias Hernandez: JavaScript allow us to update the content of our object of arrays.
0 Comments
Leave a Reply. |