category: javascript
Posted on: May 4th 2021, 3:05pm
Last modified: May 4th 2021, 3:05pm
The following code snippet helps us to loop through JSON object.
import requests from "../utils/requests";
function Nav() {
// console.log(Object.entries(requests));
return (
<nav>
<div>
{Object.entries(requests).map(([key, { title, url }]) => (
<h2>{title}</h2>
))}
</div>
</nav>
);
}
export default Nav;