class instance interface abstract-class extends implements private protected public static const constructor super read-only friendly-method event |
InstanceZNOW uses "new" syntax for creating instance. The style is similar to many OO languages. Programmers should be familiar to use it. The readability can also be maintained. var Person=Class({
init:function(firstName, lastName){
this._firstName=firstName;
this._lastName=lastName;
},
toString:function(){
return "I am "+this._firstName+" "+this._lastName+".";
},
_firstName:false,
_lastName:false
});
var johann = new Person("Johann", "Bach");
johann.toString(); //>I am Johann Bach.
|