They will be explained here.|
It's very easy if you already know C++ or an other programming language.
It should be clear that none of the classes or functions that are implemented
Some of the builtin functions are supporting overloading
and default parameters, even if this is normally not possible in JS.
But I wanted to reduce the overhead.
- Class: Foobar
// default constructor
Foobar( String text );
String foo( String text, String other_text = hello );
// do something
String foo( Int i );
// Error Code
By using a constructor a new instance of a class will be generated.
At our example there are two constructors. The only difference between
them is the number of parameters. This means you can construct the
class by using two different methods.
var foobar_1 = new Foobar();
// first method
var foobar_2 = new Foobar( "foobar" );
// second method
You can use the function as usal, but the functions can be exist more than once,
if the number of type of the parameter varies. If a value for a parameter is given
it will be used as default value.
// normal function call
foobar_1.foo( 123 );
// calling one version of the foo function
/* calling one version of the foo function, the default parameter won't be used. */
foobar_1.foo( "foo", "bar" );
/* calling one version of the foo function, the default parameter will be used. */
foobar_1.foo( "foo" );
This page was created by
. Page generator was