function MyClass() { //This function is same as a constructer alert("New Object Created"); } //Creating Object var MyObject = new MyClass (); NewObject.prototype = { //Adding Method named "MyMethod" MyMethod: function(){alert("My Method");} , //Adding property named "MyProperty" MyProperty: "My Property" } //Calling Method MyObject.MyMethod(); //Assigning Property MyObject.MyProperty = "My Property Value changed";
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com