I am an array in following format. I am reading following data from a file data.json like this
$.getJSON('data/data.json', function (ids) {
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
teams = id;
$('<li>' + id + '</li>').appendTo(span);
}
});
here is data
[
"109 200",
"109 201",
"102 202",
"103 202"
]
So what I want is to copy this array to another lets say c but in following form
[
"109",
"109",
"102",
"103",
"200",
"201",
"202",
"202"
]
How can I do this using javascript or jquery?