Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)}
   )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #loop #return
ADD COMMENT
Topic
Name
2+5 =