Search code examples
javascriptangularjslodash

Can I replace angular.copy with _lodash and would it be more efficient?


I am doing the following:

$scope.grid.backup = angular.copy(result);

Is this something that I could do with _lodash and does anyone have any ideas if the performance would be any different ?

Update:

Hard to imagine what can be unclear about:

Can I replace angular.copy with _lodash and would it be more efficient?

So for those who just don't understand I will add the word "_.clone"


Solution

  • You can use _.clone(value, [isDeep=false], [callback], [thisArg])

     $scope.grid.backup = _.clone(result);