Translate

Monday, May 5, 2014

13.Create Object

example
១៣. ការបង្កើត Object
In the above example, we have an Object Name that studentObj and property are firstname, lastname and class.
Adding Method Object
common forms
objName.method_name = function_name;

To add a method to the object, we need to create a method first and then do the same form above.
១៣. ការបង្កើត Object
Creating Object Alternative forms
example
១៣. ការបង្កើត Object
Creating Object Constructor
example
១៣. ការបង្កើត Object
In the above example to create Object through a constructor, we have to create a function Create Object function.

0 comments:

Post a Comment