Create an instance of object in javascript

Here we take an example in which we create an instance of object in javascript.

<html>
<body>
<script type="text/javascript">
x={Fname:"Mahak",Lname:"Garg"}
document.write( "My Name is " + x.Fname + " " + x.Lname);
</script>
</body>
</html>


Output:

1.png
Ebook Download
View all
Learn
View all