> LeekScript
LeekScript 3 is the third version of LeekScript, released on November 30, 2021.
You can now declare anonymous objects with the following syntax:
And use them like a regular object:
These objects belong to the Object class and cannot have methods, apart from Object.keys() and Object.values(). You can add fields to them on the fly:
Here are all the keywords reserved from LeekScript 3 onward, which cannot be used to name a variable, a function, a class, a method, a field, etc. Not all of them are used in the language yet: some are set aside for future versions:
The following reflection methods and fields are added:
Object.keys(): returns an array of the object's keys (or fields), as strings:{ x: 1, y: 2 }.keys() === ['x', 'y'].Object.values(): returns an array of the object's values:{ x: 1, y: 2 }.values() === [1, 2].Class.name: returns the name of the class.Class.super: returns the superclass of the class, or null if it has none.Class.fields: returns an array of the class's fields (as strings):class A { a b } A.fields === ['a', 'b'].Class.staticFields: returns an array of the class's static fields (as strings):class A { static c static d } A.staticFields === ['c', 'd'].Class.methods: returns an array of the class's methods (as strings):class A { m() {} n() {} } A.methods === ['m', 'n'].Class.staticMethods: returns an array of the class's static methods (as strings):class A { static o() {} static p() {} } A.staticMethods === ['o', 'p'].Base classes are introduced into the language:
null valuestrue and false12, 5.571, etc.12, -5, etc.[1, 2, 3], etc."hello", etc.{ x: 12 }, etc.function() {}Number, Array, MyClass, etc.So you can create values with these classes:
And use instanceof:
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.