Consider an array containing various objects:
let newArray = [
{ name: 'Alice', score: 15 },
{ name: 'Bob', score: 30 },
{ name: 'Eve', score: 18 }
]
Is there a more concise way to replace Bob's object with a new object in the array like this:
let updatedScoreForBob = { name: 'Bob', score: 35 }
Instead of finding the index and updating, is there a simpler one-liner method?