Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: bejoy balan
Added: Jun 25, 2021 10:01 PM
Views: 38
Tags: reactjs sort
  1. {products
  2.    .sort(({ id: previousID }, { id: currentID }) => previousID - currentID)
  3.    .map(({ id, headline }) => (
  4.      <Container key={id}>
  5.        <Row>
  6.          <Col>
  7.            <p>id={id}</p>
  8.            <p>headline={headline}</p>
  9.          </Col>
  10.        </Row>
  11.      </Container>
  12.    ))
  13. }