Create an instance of object in javascript

Introduction

 
Here we take an example in which we create an instance of an object in javascript.
  1. <html>  
  2.   
  3.    <body>  
  4.       <script type="text/javascript">  
  5.       x = { Fname: "Mahak", Lname: "Garg" }  
  6.       document.write("My Name is " + x.Fname + " " + x.Lname);  
  7.       </script>  
  8.    </body>  
  9.   
  10. </html> 
Output:
 
1.png
Next Recommended Reading Four Ways To Create JavaScript Objects