Foreach - iterate over array



    Jose Romero

    TypeScript recipes

    The code looks for a function named "forEach" and calls it with the currentItem as its parameter. The forEach() function takes two parameters: an Array object and a callback function. The callback function will be called for every item in the Array object.

    Shortcut: for.each

    array.forEach((currentItem) => {});
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.