In my array I am using .find to find an object and set its property to some value. I want to set the name only if there is a value. i.e; check for undefined Below is my array, am using .find to find the object and set its name. I want to set only if the object with id === checkid is found.
this.myarray.find(colDef => colDef.id === checkid).name = newname;.