• JaddedFauceet@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 个月前

    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()];