I have to create my customized grouping order based on standardID in the following array of objects:
Actual Array:
var test=[
{ID: "91",Name: "sgtue", standardID: "1"},
{ID: "41",Name: "asdfasdf", standardID: "2"},
{ID: "5", Name: "credd", standardID: "2"},
{ID: "2",Name: "dddawer", standardID: "2"},
{ID: "2",Name: "dsfadf", standardID: "3"},
{ID: "275", Name: "xcvcvc", standardID: "201"}
]
Expected Result: I Simply want to group the standardID's like 1,3,2,2,2,201
[
{ID: "91",Name: "sgtue", standardID: "1"},
{ID: "2",Name: "dsfadf", standardID: "3"},
{ID: "275", Name: "xcvcvc", standardID: "201"},
{ID: "41",Name: "asdfasdf", standardID: "2"},
{ID: "5", Name: "credd", standardID: "2"},
{ID: "2",Name: "dddawer", standardID: "2"}
]
Kindly help me to sort out the problem.
1 3 2 2 2 201grouped? I don't see a logic behind it!