AngularJS – extends vs copy (v5)

Revision 5 of this benchmark created by testssss on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>

<script>
  var obj = {
   a: 1,
   b: 2,
   c: 3,
   d: 4,
   e: 5,
   f: function() {
    return 6;
   },
   g: [7, 8, 9]
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
AngularJS – .extend()
angular.extend(obj, {});
ready
AngularJS – .copy()
angular.copy(obj, {});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.