• JaddedFauceet@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    Looks confusing at first, but I found it nice for accessing a month array.

    const months = ["Jan", "Feb", ...];
    
    months[0] === "Jan";
    
    const label = months[date.getMonth()];