Maps are iterable and ordered, but they are not arrays so they don’t have any indexed access. Iterating to the final element is the best you can do. The simplest case being
Array.from(map.values()).pop();
Maps are iterable and ordered, but they are not arrays so they don’t have any indexed access. Iterating to the final element is the best you can do. The simplest case being
Array.from(map.values()).pop();