I am trying to sort array of JSON values, but the property to sort is nested within the JSON object. For this example the sort is to be done using data.nested-name.
I tried using https://stackoverflow.com/a/8175221/2053159 but without any success.
[
{
name: 'a75',
data: {nested-name:"zz\, Hello// There="}},
{
name: 'z32',
data: {nested-name:"aa\, Hello// There="}},
];
expected output ->
[
{
name: 'a75',
data: {nested-name:"aa\, Hello There="}},
{
name: 'z32',
data: {nested-name:"zz\, Hello There="}},
];
Nested name do contain lot of back and forward slashes and other special characters. I don't use external libraries, please provide solutions using native JavaScript.