Skip to content

Instantly share code, notes, and snippets.

@jeanmachuca
Created June 16, 2019 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanmachuca/c39b6c11cc7e7fb117bced867f4dd6ef to your computer and use it in GitHub Desktop.
Save jeanmachuca/c39b6c11cc7e7fb117bced867f4dd6ef to your computer and use it in GitHub Desktop.
QCObjects Class Declaration Example
Class('MyClassName',InheritClass,{
propertyName1:0, // just to declare purpose
propertyName2:'',
classMethod1: function (){
// some code here
// note you can use "this" object
return this.propertyName1;
},
classMethod2: function () {
// some code here
return this.propertyName2;
}
});
var newObject = New(MyClassName,{
propertyName1:1, // this initializes the value in 1
propertyName2:"some value"
});
console.log(newObject.classMethod1()); // this will show number 1
console.log(newObject.classMethod2()); // this will show "some value"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment