ClickEvent and Update Array

Hi there,

suppose I have an array(1) of length 1, and I want to click a table row or some button, how can I update that array(1) to array(2) of the response of the event?

Thanks

How’s this example?

htl.html`<button onClick=${handleClick}>Add to array</button>`
handleClick = () => {
  mutable arr.push(new Date());
  mutable arr = mutable arr; // assignment triggers reactive update
}
mutable arr = [new Date()]