Answer the question
In order to leave comments, you need to log in
How to update a property whose name was passed as an argument?
There is an interface
export interface User {
userID: number,
role: string,
name: string,
active: boolean,
phone: string
}
const onUserChange = (user: User, accessor: string, value: string) => {
user[accessor] = value;
return user;
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question