I'm have array of object like this
export interface NoteI {
id?: number | Date;
header?: string;
note?: string;
date?: Date;
}
let NoteList: NoteI[] = [
{
id: 1,
header: "sample header",
note: "sampple note",
date: new Date()
},
{
id: 2,
header: "sample header",
note: "sampple note",
date: new Date()
},
{
id: 3,
header: "sample header",
note: "sampple notasdsdsa das dsdsdsdsd e",
date: new Date()
}
];
Now I want to edit one element, for example, the first item, like below, I want to edit something like:
{
id: 1,
header: "sample header newww",
note: "sampple note new tooo",
date: new Date()
},
And return updated array, include edited element How can I achieve this?