Result Size: 625 x 534
x
 
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript 显示对象</h2>
<p>JSON.stringify 可以对数组进行字符串化:</p>
<p id="demo"></p>
<script>
var arr = ["John", "Peter", "Sally", "Jane"];
var myString = JSON.stringify(arr);
document.getElementById("demo").innerHTML = myString;
</script>
</body>
</html>