Javascript logo

Obviously, it's a often cased task to update an object, or even a property in one object the array of objects. Especially it's actual for React applications.

You can use spread to make a copy and then to update previous value. But why to make garbage in memory?

The best solution is with map

        const newMatches = (x, ind) => {
            return (ind === index) ? { ...x, avG: parseInt(, 0) } : x

Have questions? write down in the comments