Given:
var a1 = [{name:'Scott'}, {name:'John'}, {name:'Albert'}];
var sortOrder = ['John', 'Scott', 'Albert'];
How can I sort the first array (by property) based on the order specified in the second array.
// result: [{name:'John'}, {name:'Scott'}, {name:'Albert'}]
Thanks.