I copied an array to a temporary variable tempPropertyValuesArray
And then when I cleared the original array $scope.advancedSearch.businessCard.propertyValues
It also cleared the tempPropertyValuesArray
I am surprised. Is this the expected behavior ?
Javascript:
var tempPropertyValuesArray = $scope.advancedSearch.businessCard.propertyValues;
$log.debug("tempPropertyValuesArray 1 : " +tempPropertyValuesArray);
$scope.advancedSearch.businessCard.propertyValues.length = 0;
$log.debug("tempPropertyValuesArray 2 : " +tempPropertyValuesArray);
Logs:
tempPropertyValuesArray 1 : [object Object],[object Object]
tempPropertyValuesArray 2 :