Here we take an example in which we create an instance of an 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: