Answers for "how to get one element from a loop in react"

0

react loop return

function Example(num){
    const output = new Array();
    for(let i = 0; i< num ; i++){
        output.push(<Component />)
    }
    return output;
}
  
 return(
   {get_comments(this.props.comments)}
   )
Posted by: Guest on April-22-2022

Code answers related to "how to get one element from a loop in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language