Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

objects in javascript

var student = {                 // object name
firstName:"Jane",           // list of properties and values
lastName:"Doe",
age:18,
height:170,
fullName : function() {     // object function
   return this.firstName + " " + this.lastName;
}
}; 
Source by htmlcheatsheet.com #
 
PREVIOUS NEXT
Tagged: #objects #javascript
ADD COMMENT
Topic
Name
2+4 =