In JavaScript, is it possible to do something akin to an optional chain on Array.find? I.e., like in the (incorrect) example below?
let myArray = [{name: "foo", value: 30}, {name: "abc", value: 40}];
myArray.find(entry => entry.name === 'foo')?.value = 50;
I tried the above syntax, but it throws an error, and I was wondering if there is some neat one-line way to achieve this without having to declare another variable to store the Array.find result and check if it is truthy before you can set value = 50.