I'm new to coding and this situation poses quite a problem for me. I'm working with reactjs and inside a function I have props like this:
const{a,b,c,d,e,f,g,h} = props
So 'props' is an object, 'c' is an array, inside 'c' are 100 objects ranging from 'idx' 0 to 99, all these objects have an identical property call 'x', 'x' value is boolean 'true' or 'false'. I want to know the best way to loop through all these 100 objects so it will return 'true' or 'false'
Basically, c is like this:
let c = [{x:true},{x:true},{x:false}];
I only know so far as
console.log ('show value', props.c[idx])
to show key and value inside this object but cannot take the key I want by props.c[idx].x . I think I was wrong some where. Please help
Bonus: I want to know this so for every 'true', a button TRUE appear and vice versa, it's kinda like this
{!x (<button> False </button>)}