• JaddedFauceet@lemmy.world
    cake
    link
    fedilink
    arrow-up
    1
    ·
    5 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()];