I am trying to take the latest value form the getSelectedNodes array. Below code is working but getting output like first time is [5] second time is [5,6].
const currentIndex = this.gridApi.getSelectedNodes().filter(
(item: any) => item.rowIndex >= 5).map((count: any) => count.rowIndex);
The above code is working on a click event.
Each click event I need only the current value. No need to keep the old one.
How can we do it in type script?