title: An alternative method for JSON.stringify()
body: <p>I want an alternative method for JSON.stringify(). 
  I am using JSON.stringify and I got error like cyclic object value. I don't know how to remove this error so I'd like to know if there's an alternative method.  </p>
  
  <pre><code>DCSSPACE.SaveAndOpenJSONWriter = function(canvas) {
  
      //multiple tab.....
      var mydata = [];
      var area = {}, DCS = {}, workspace = {};
      var len = DCSSPACE.collection.length;
      for (var k = 0; k &lt; len; k++) {
          var result = [];
          var tabid = DCSSPACE.collection.models[k].id;
          var canvas = DCSSPACE.collection.get(tabid).get("workflow");
          //for node
          var figures = canvas.getFigures();
          for (var i = 0; i &lt; figures.getSize(); i++) {
              if (figures.get(i).type == "draw2d.Node") {
                  var node = {};
  
                  node.blockType = getBlockType(figures.get(i));
                  node.x = figures.get(i).getX();
                  node.y = figures.get(i).getY();
                  node.id = figures.get(i).getId();
                  node.type = figures.get(i).type;
                  node.width = figures.get(i).getWidth();
                  node.height = figures.get(i).getHeight();
                  node.label = figures.get(i).getLabel();
                  node.sequenceNo = figures.get(i).getSequenceNo();
              node.model = figures.get(i).model;
  
                  result.push(node);
              }
          }
          //for lines
          var lines = canvas.getLines();
          for (var j = 0; j &lt; lines.getSize(); j++) {
              if (lines.get(j).type == "draw2d.nodeConnetion") {
                  var nodeConnection = lines.get(j).getConnectionAttrubutes();
  
                  nodeConnection.source = lines.get(j).getSource();
                  nodeConnection.target = lines.get(j).getTarget();
                  result.push(nodeConnection);
              }
          }
          area = {
              tabid : tabid,
              attr : result
          };
  
          mydata.push(area);
          result=[];
          workspace = {
              DCS : mydata
          };
      }
      //console.log(mydata);
      var arr = JSON.stringify(workspace, null, 4);
      console.log(arr);
      DCSSPACE.SaveAndLoadFigure = result;
  
      return workspace;
  
  };
  </code></pre>