I am a novice to React and I am stuck in something. I have an array in the state which contains an object in it. The array looks like this:
myVar = [
{
"a": 1,
"b":2
},
{
"c":1,
"d":1
},
{
"e":"",
"f":4
}
];
I want to check somehow that does the array contains a key a
or c
or f
by using this.state.myVar
syntax. It doesn't matter what value it contains. It can be null.
I couldn't find a way to check it using JSX.
My output depends on it. Like if the array contains a key called a or c or f
then it will display data depending on the available key. I can do this part but not sure how can I check for the availability of the key. Please Help me on that.