[JavaScript] JSON.stringify()
2023. 1. 13. 20:55
프로그래밍/JavaScript
JSON.stringify() JavaScript 값이나 객체를 JSON 문자열로 변환함 console.log(JSON.stringify({ x: 5, y: 6 })); // expected output: "{"x":5,"y":6}" console.log(JSON.stringify([new Number(3), new String('false'), new Boolean(false)])); // expected output: "[3,"false",false]" console.log(JSON.stringify({ x: [10, undefined, function(){}, Symbol('')] })); // expected output: "{"x":[10,null,null,null]}" console.log(J..