เพื่อพิมพ์เนื้อหาของ JavaScript Object ใช้โค้ดตัวอย่าง Object สร้างด้วย new Keyword
ตัวอย่าง
<!DOCTYPE html> <html>
<body>
<p id="test"></p>
<script>
var dept = new Object();
dept.employee = "Amit";
dept.department = "Technical";
dept.technology = "C++";
document.getElementById("test").innerHTML =
dept.employee + " is working on " + dept.technology + " technology.";
</script>
</body>
</html>