• Spring
  • SQL Tutorial
  • Java IO
  • JSP
  • JavaScript
  • PHP
  • jQuery
  • Core Java
  • Struts

  • <

    Reactjs List

    Lists are used to display data in an ordered format.


    Example



    
    var numbers = [1, 2, 3, 4, 5];   
    const multiplyNums = numbers.map((number)=>{   
        return (number * 5);   
    });   
    console.log(multiplyNums);   
    
    
    

    output:
    [5, 10, 15, 20, 25]
    


    Example2


    import React from 'react';   
    import ReactDOM from 'react-dom';   
      
    const myList = ['alu', 'sunil', 'jitu'];   
    const listItems = myList.map((myList)=>{   
        return <li>{myList}</li>   
    });   
    ReactDOM.render(   
        <ul> {listItems} </ul>,   
        document.getElementById('app')   
    );   
    export default App;  
    
    
    
















    © copyright 2017-2021 Completedone pvt ltd.