| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/JSON/rawJSON | [Back] [Original] |
Get to know MDN better
JSON.rawJSON() JSON JSON JSON JSON JSON JSON
JSON.rawJSON(string)
stringJSON JSON
JSON null
rawJSON JSON string
JSON JSON.stringify() JSON.isRawJSON()
SyntaxError string JSON
JSON.stringify({ value: 12345678901234567890 });
// {"value":12345678901234567000}
JavaScript 12345678901234567890 JavaScript
JSON.rawJSON JavaScript JSON.stringify 12345678901234567890 JSON JSON.stringify()
const rawJSON = JSON.rawJSON("12345678901234567890");
JSON.stringify({ value: rawJSON });
// {"value":12345678901234567890}
JSON.rawJSON() JSON JSON JSON.rawJSON()
const rawJSON = JSON.rawJSON('"Hello world"');
JSON.stringify({ value: rawJSON });
// {"value":"Hello world"}
JSON.rawJSON JSON JSON JSON JSON.rawJSON()
const rawJSON = JSON.rawJSON('"Hello\nworld"'); // JSON Syntax error
JSON JSON.rawJSON()
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
const arrJSON = JSON.rawJSON("[1, 2, 3]");
const objJSON = JSON.rawJSON('{"a": 1, "b": 2}');
// SyntaxError
JavaScript JSON JSON JSON
console.log(JSON.stringify({ value: "\ud83d\ude04" })); // {"value":""}
Unicode
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 |