> LeekScript
Since update 2.38, you can use types in LeekScript.
void: no typeany: any valuenull: null valueboolean: Boolean valueinteger: whole numberreal: real numberBigInteger / big_integer: whole number of arbitrary sizestring: character stringArray, Array: list, or list of values of type XMap, Map: map, or map with keys of type K and values of type VObject: objectFunction, Function R>: any function, or a function that takes arguments of types A and B and returns a value of type R.Class: classUse the | sign to create compound types: for example, integer | string represents a value that can be either an integer or a string.
You can combine as many types as you like: integer | boolean | string | Array, for example.
To write a compound type with null, such as Array | null, you can write Array?.
The ! operator changes the type of a value by removing the null type. It does not convert the value, nor does it make using it any safer. For example, for a type integer | null:
You can use it in a chain of object accesses: object.foo!.bar However, if object.foo is null, it will crash at runtime. Today, this operator is mostly useful for removing warnings in strict mode with typing, and for making sure a variable is not null at runtime.
The as operator converts a value to any type, if possible:
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.