1var arr = [34, 234, 567, 4];
2print(arr);
3var new_arr = arr.reverse();
4print(new_arr);
5
1import React, { Component } from 'react';
2
3export default class Slideshows extends Component {
4 constructor(){
5 super();
6 this.state = {
7 data:[
8 { "id": "1", "name": 'Robert', "age": "21" },
9 { "id": "2", "name": 'Sam', "age": "33" },
10 { "id": "3", "name": 'Jerry', "age": "42" },
11 ]
12 }
13 }
14 render() {
15 const reverseData = this.state.map((data, i) => {
16 return (
17 <li> {data.name} | {data.age} </li>
18 )
19 })
20 return (
21 <ul>
22 {reverseData}
23 </ul>
24 )
25 }
26}
27