JSFiddle - React, Tailwind, and code Playground

by cmruser

JavaScript

const menus = [
{
	id: 1,
  name: 'home'
},
{
	id: 2,
  name: 'welcome'
},
];

const id = menus.find(m => m.name == 'home').id;

console.log(id);