I am working with two arrays of objects:
arr1 = [{chart: {field: "test", title: "ABC", type: 0}}, {chart: {field: "test", title: "123", type: 1}}, {chart: {field: "test", title: "XYZ", type: 2}}]
arr2 = [{Name: "XYZ"}, {Name: "ABC"}, {Name: "123"}]
Is there a way to sort arr2 based on the values found in the title property of arr1?
The intended result should look like this:
[{Name: "ABC"}, {Name: "123"}, {Name: "XYZ"}]