0

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?

Heretic Monkey
  • 11,078
  • 7
  • 55
  • 112
CODEforDREAM
  • 434
  • 1
  • 2
  • 11

0 Answers0