Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to merge array into JSON array

$scope.combineComments = function (){
    var jsonStr = $scope.projectDetails.Comments;
    var obj = JSON.parse(jsonStr);
          
    obj.push({"Author":"Test","Text":$scope.NewComment});
          jsonStr = JSON.stringify(obj);
    }
}
 
PREVIOUS NEXT
Tagged: #How #merge #array #JSON #array
ADD COMMENT
Topic
Name
5+7 =