Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Objects</h1>
<h2>The : Operator</h2>
<p id="demo"></p>
<script>
const size = {x: 5, y: 10, z: 1};
document.getElementById("demo").innerHTML = "The width is "  + size.x;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_assign_colon by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:06:51 GMT -->
</html>