Here’s an example SmallJS class declaration
containing

Explanation of syntax used:
CLASS : Is followed by the class name.
EXTENDS : Indicates the base class. Object is the root class.MODULE : The JS module this class should be put in.CLASSVARS : Variables of the class itself (not its instances). Like JS static class vars.VARS : Instance variables of objects created from the class, e.g.: MyTest new."This is a comment ..." : Comments are put in double quotes.CLASSMETHODS : Following methods will be added to the (meta)class, like JS static class methods.METHODS : Following methods will be added to class instances, like JS regular class methods.CLASSMETHODS nor METHODS is specified.)method1 : Unary method, has no arguments.++ var : Binary (operator) method, has one argument.method2Arg1: aVar1 arg2: aVar2 : Keyword method, has one or more arguments.| locVar lv2 lv3 | : Local variables declaration.! : End of method'aaa': String, uses single quotes1 : Integer3.14 : Floattrue, false: Booleannil : Nil singelton, like JS null.$c : Charactervar1 := 3 : variable assignment
var1 = 3 tests for equality.^ 42 : Return a value.#( 1 3.14 'aaa' ) : array with 3 values.[ 1 + 2 ] : block, like JS lambda functions.
[ :a | :b | ^ a + b ] : block with 2 arguments returning sum from method (not block).INLINE : Inline JS code, not transpiled.1 + 2 = 3 ifTrue: [ 'Checks out' ]a > 0 ifTrue: [ 'Positive' ] ifFalse: [ 'Zero or negative' ]1 to: 10 do: [ :n | self log: n ][ a > 0 ] whileTrue: [ self log: a. a decrement ][ self log: a. a decrement ] doWhile: [ a > 0 ]