📜  通过对象数组反应js循环 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:16.438000             🧑  作者: Mango

代码示例1
var links = [
  { endpoint: '/america' },
  { endpoint: '/canada' },
  { endpoint: '/norway' },
  { endpoint: '/bahamas' }
];

class Navigation extends React.Component {
  render() {
    const listItems = links.map((link) =>
        
  • {link.endpoint}
  • ); return (
      {listItems}
    ); }