JavaScript Objects


JavaScript is an object oriented programming language, which includes the following two features:
The code creates an instance of an object and adds two properties and one method to it. Note that methods are just functions attached to objects. Then we will have to write the createID function, which creates an ID for the customer. JavaScript knows which person you’re talking about by using this. So, now you can use the method user.createID. The example creates an object by using a template. You may also use the Object type to create an object.



   

Demonstration
The following demonstration shows how the script of HTML and JavaScript is displayed on the Web.

     





      A guy catches his wife in bed with his best friend,    
      and he goes, “Sal, I have to! But you?”    
      — Wayne Federman