How to deep clone this part of javascript? -


still new in js overall , i'm trying deep clone part of code.

$scope.add = function() {   $scope.data.push(object.assign(mock)); }; 

if me cloning this, grateful. thanks

use angular's .copy() method clone.

like this

$scope.data.push(angular.copy(mock));