Get items from array

    0

    0

    My JavaScript recipes

    Get the first n items of an array

    const items = [1,2,3,4,5,6];
    const firstThreeItems = items.slice(0, 3);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.