How do I get the number of JSON elements based on a key match?
When I select react, it should only iterate through 2 elements.
When I select material-ui, it should only iterate through the remaining where it matches material-ui and therefore ignore the first two reacts (starting from third index in this example)
Ben
Group.kmactions (6.8 KB)
See XY problem - Wikipedia
What is the output that you want to create ?
(You would need to show us an example)
Well
The json has alot of elements where the key can be anything.
So I scan through the keys looking for eg. "react" chosen that I chose to read. When I find a match, I output the value assigned to that key.
Find a key that Matches React, if yes, output its value eg. import React from 'react'
However since it is iterating through the entire json, by the third time, there is 'material-ui' and that does not match but it still returns something like undefined'
So I only want to return values where values are matched.
To me its a parsing problem but hey I couldnt figure it out cos simply not enough or its scattered somewhere in cyberspace lol.
It shouldnt be iterating through the entire range when I only need values from a certain range.
Ben
And an example of the output you are trying to produce there ?