0
Var list = [{"Language":"english","direction":"null"},{"Language":"French","direction":"RTL"},  {"Language":"ARABIC","direction":"RTL"}]

I need to find if english is there and if true return its direction.

I tried with the following code.

Object.keys(list).forEach(function(key){
if(list[key].hasOwnProperty("English")) return true
});

Can anyone tell how do we achieve this ?

  • You are checking if a property `English` exists and not if the property `language` has the desired value `english`. – Lain Sep 20 '21 at 10:46

0 Answers0