Why can the same JSON.parse be used under IE but not under CHROME?

  node.js, question

This is the only way under Google.
I want to continue to add objects. I hope it looks like this

There are no problems under IE.

Sorry, the problem was not clearly described.

var $goodsNo = $('#goods-no').val();
 var $buyNum = $('#buy-num').val();
 var goods = new Object();
 goods.goodsNo = $goodsNo;
 goods.buyNum = $buyNum;
 var cookieValue = getCookie("goods");
 if (cookieValue == "") {
 var arr = [];
 var jsonStr = JSON.stringify(arr);
 } else {
 var oldGoodsValue = base64Decode(cookieValue);
 var jsonObject = JSON.parse(oldGoodsValue);
 var jsonStr = JSON.stringify(jsonObject);
 setCookie("goods", base64Encode(jsonStr), 3000);

There was an error when I converted the json string (oldGoodsValue) into an array of JSON objects, that is
var jsonObject = JSON.parse(oldGoodsValue);
There is a mistake in this sentence.

The error message is this uncaught syntax error: unexpected token.

OldGoodsValue value is


It is possible that the characters cannot be processed because they are not escaped. . I just escaped them on the console.
However, there is a question, why does it not escape automatically? Although it can be escaped manually, what should I do if I encounter quotation marks?

The problem has been solved. It is the base64 decoding function that has a problem. .

I don’t know what you want, can you describe the problem more clearly?