NextJs / Basics / array looping
Array Looping
-
Step
using map() 'use client' import React from 'react'; const students = [ { 'id': 1, 'name': 'Jack', 'email': 'jack@gmail.com' }, { 'id': 2, 'name': 'Mary', 'email': '?mary@gmail.com' }, { 'id': 3, 'name': 'John', 'email': 'john@gmail.com' }, ]; export default function Home() { return ( -
{students.map((item) => (
- {item.name} ))}