<html>
<body>
<h1>JavaScript Objects</h1>
<h2>The Object.seal() Method</h2>
<p id="demo"></p>
<script>
const fruits = [& quot; Banana & quot;, & quot; Orange & quot;, & quot; Apple & quot;, & quot; Mango & quot;];
Object.seal(fruits);
// Test Error
let text = "";
try {
fruits.push("Kiwi");
}
catch (err) {
text = err;
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
<!-- /jsref/tryit.asp?filename=tryjsref_object_seal
</html>