Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global G = { /* static and default data goes here */ };
- // creation function, no specific name required
- function G.create( msg )
- {
- return class( {msg=msg}, G );
- }
- // some member function (because there's "this" inside it)
- function G.print()
- {
- println( this.msg );
- }
- var myg = G.create( "yo!" );
- myg.print();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement