Mapping through an array

    0

    0

    John Jones

    Inside the arrow function, index is 0 and element is "foo". The value of element is "foo".

    Library: react

    {names.map((element,index)=>{ console.log(‘inside arrow function’) console.log(‘index is ‘+index+‘ element value is :’+element)})
    
    or
    
    <ul>
      {todos.map(todo=>(
        <li>{todo}</li>
      ))}
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.