I have a result of array which contain multiple objects and i need to merge this result set in single array using java-script. I have tried with many of JavaScript functions but no success. Also this one have response generated after using array.push
.
Response
[
[Object {
category_of_student = "Freshman", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
Object {
category_of_student = "Freshman", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
Object {
category_of_student = "Ophomore", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
26 more...
],
[Object {
category_of_student = "Junior", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
}]
]
Code
var yourCat = item.category_of_student;
var optionVal = [];
for (i = 0; i < yourCat.length; i++) {
var res = ($filter('filter')(item, {
category_of_student: yourCat[i]
}));
optionVal.push(res);
}
Require Result
[
Object {
category_of_student = "Freshman", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
Object {
category_of_student = "Freshman", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
Object {
category_of_student = "Ophomore", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
},
26 more...,
Object {
category_of_student = "Junior", your_school = "(BA Bs)Bachelor of Scien...Business Administration", college = "Business of Unit", more...
}
]
concat
?category_of_student = "Ophomore",
becategory_of_student: "Ophomore",
?