Considering the following JSON object example as input, how would you use Javascript to duplicate each object based on the number of times found in the “Count” key/value pair?
Example Input:
[
{
"name":"David",
"Count":2
},
{
"name":"John",
"Count":3
}
]
Example Output:
[
{
"name":"David"
},
{
"name":"David"
},
{
"name":"John"
},
{
"name":"John"
},
{
"name":"John"
}
]