I have the following big array:
var divs = [
{class:'A', top:0, left:0},
{class:'B', top:50, left:60},
{class:'C', top:30, left:10},
{class:'D', top:100, left:180},
{class:'E', top:80, left:50},
{class:'F', top:100, left:200},
{class:'G', top:50, left:80}
];
I’d like to isolate just the top values. I tried using split() but I might not be using it correctly because nothing returns as expected.
Once the top values are isolated into their own smaller array I want to iterate over it and find the frequency of occurrence for each value.
Can I please get some help?
At this point, you will have a topsy that has all of the tops in there, with the key being the top, and the value being the number of times it was in there. To get a list of the keys, you say:
Object.keys doesn’t work in IE.
You will end up with topsy =
Then you can say
You got your analysis and array done at one time.