[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/JSON/rawJSON [Back]  [Original]

JSON.rawJSON() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

JSON.rawJSON()

Baseline 2025

20253

JSON.rawJSON() JSON JSON JSON JSON JSON JSON

js
JSON.rawJSON(string)

string

JSON JSON

JSON null

rawJSON

JSON string

JSON JSON.stringify() JSON.isRawJSON()

SyntaxError

string JSON

JSON JSON JSON.stringify

js
JSON.stringify({ value: 12345678901234567890 });
// {"value":12345678901234567000}

JavaScript 12345678901234567890 JavaScript

JSON.rawJSON JavaScript JSON.stringify 12345678901234567890 JSON JSON.stringify()

js
const rawJSON = JSON.rawJSON("12345678901234567890");
JSON.stringify({ value: rawJSON });
// {"value":12345678901234567890}

JSON.rawJSON() JSON JSON JSON.rawJSON()

js
const rawJSON = JSON.rawJSON('"Hello world"');
JSON.stringify({ value: rawJSON });
// {"value":"Hello world"}

JSON.rawJSON JSON JSON JSON JSON.rawJSON()

js
const rawJSON = JSON.rawJSON('"Hello\nworld"'); //  JSON  Syntax error

JSON JSON.rawJSON()

JSON.rawJSON() JSON

js
const numJSON = JSON.rawJSON("123");
const strJSON = JSON.rawJSON('"Hello world"');
const boolJSON = JSON.rawJSON("true");
const nullJSON = JSON.rawJSON("null");

console.log(
  JSON.stringify({
    age: numJSON,
    message: strJSON,
    isActive: boolJSON,
    nothing: nullJSON,
  }),
);

// {"age":123,"message":"Hello world","isActive":true,"nothing":null}

JSON.rawJSON() JSON

js
const arrJSON = JSON.rawJSON("[1, 2, 3]");
const objJSON = JSON.rawJSON('{"a": 1, "b": 2}');
// SyntaxError

JSON.rawJSON()

JavaScript JSON JSON JSON

js
console.log(JSON.stringify({ value: "\ud83d\ude04" })); // {"value":""}

Unicode

js
const rawJSON = JSON.rawJSON('"\\ud83d\\ude04"');
const objStr = JSON.stringify({ value: rawJSON });
console.log(objStr); // {"value":"\ud83d\ude04"}
console.log(JSON.parse(objStr).value); // 

rawJSON

JSON.parse source text access
# sec-json.rawjson


Web Proxy Viewer  |  New URL  |  Original Page