I am trying filter the object and when I do it I am getting this error what actually it is saying I am not getting it.
Expected an identifier and instead saw 'let'.
This is my filter function
var arr = $scope.items; //object data
var stringToFilter = newSortingOrder.toString();
let obj = arr.find(o => o.id === stringToFilter); //error stopping in this line.
let obj = arr.find(o => o.id === stringToFilter);
Is ES2015/ES6 (they're the same) syntax and, although it's not exactly new, not all environments will support it.
Use ES5 syntax instead to resolve your issue. It's much more widely supported.
var obj = arr.find(function(o) { return o.id === stringToFilter; });