关于js数组根据属性值，依照要求的属性值对数组进行排序求助

//原始数组

var row = [{title:'a',name:'000000000101500141'},{title:'a',name:'000000000101500147'},{title:'a',name:'000000000101500142'},{title:'a',name:'000000000101500144'},{title:'b',name:'000000000101500145'}];

//排序顺序的要求

var sort = ['101500142','101500141','101500149','101500199','101500144'];

1、原始数组的数据是没有顺序的

2、排序顺序的值可能在原始数组内没有的

var newArray = [{title:'a',name:'000000000101500142'},{title:'a',name:'000000000101500141'},{title:'a',name:'000000000101500144'},{title:'a',name:'000000000101500147'},{title:'b',name:'000000000101500145'}];

0
```function arrSort(_row, _sort) {
if(_row == null || _row.length == 0) {
return _row;
}
var _indexArr = new Array();
var _newArray = new Array();
\$.each(_sort, function(sIndex, val) {
\$.each(_row, function(rIndex, item) {
if(item.name.indexOf(val) >= 0) {
_indexArr.push(rIndex);
_newArray.push(item);
return false;
}
});
});
\$.each(_row, function(rIndex, item) {
var _flag = false;
\$.each(_indexArr, function(iIndex, i) {
if(rIndex == i) {
_flag = true;
}
});
if(!_flag) {
_newArray.push(item);
}
});
return _newArray;
}```

0
```var newArray = _row.sort(function(obj1, obj2){
var _index1 = _row.length;
var _index2 = _row.length;
_sort.filter(function(str, index){
if(obj1.name.indexOf(str) >= 0) {
_index1 = index;
} else if(obj2.name.indexOf(str) >= 0) {
_index2 = index;
}
});
return _index1 - _index2;
});```

3Q