json = "{
nameEnglish: "name 1",
name: "имя 1",
},
{
nameEnglish: "name 2",
name: "имя 2",
},
{
nameEnglish: "name 3",
name: "имя 3",
}";
[
{
"nameEnglish": "name 1",
"name": "имя 1"
},
{
"nameEnglish": "name 2",
"name": "имя 2"
},
{
"nameEnglish": "name 3",
"name": "имя 3"
}
]
function getNameByEnglishName(englishName) {
const el = json.find((el) => el.nameEnglish === englishName);
return el.name;
}