[
{name:"foo", value:"1", order:"1.1.12"},
{name:"foo bar", value:"2", order:"2.10.1"},
{name:"bar", value:"3", order:"1.11.5"},
{name:"baz", value:"4", order:"2.6.2"},
{name:"foo baz", value:"5", order:"1.3.10"}
]
How can i sort this list by order
with the help of underscore.js (or without).
so i will end up with this:
[
{name:"a", value:"1", order:"1.1.12"},
{name:"a", value:"5", order:"1.3.10"},
{name:"a", value:"3", order:"1.11.5"},
{name:"a", value:"4", order:"2.6.2"},
{name:"a", value:"2", order:"2.10.1"}
]
It's worth mentioning that order
could be any digit long for example it could be:
1.1
2
3.1.2.3
so the solution has to be generic as possiable.