You can pass an array to the constructor Map:
const map = new Map([...Array(48)].map((_, i) => [i + 1, '0']));
If your first key might be 0instead 1, this would be a cleaner solution:
const map = new Map(Array(48).fill('0').entries());
source
share