- variables
- comments
- array
- array concat single line statement
- array concat multi line statement
- array concat mixed line statement
- array forEach statement with default thisArg
- array forEach statement with explicit thisArg
- array filter statement with default thisArg
- array filter statement with explicit thisArg
- array find statement with default thisArg
- array find statement with explicit thisArg
- array reduce statement
- objects
- function
- call
- conditionals
- loops
- class
- logger
- debug
- react
Variable declaration
1 module2 kind es63 var i4 var i = 05 var6 decl a7 decl b8 decl c = 999 let i10 let i = 011 let12 decl a13 decl b14 decl c = 9915 const i16 const i = 017 const18 decl a19 decl b20 decl c = 99
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var i;
var i = 0;
var a,
b,
c = 99;
let i;
let i = 0;
let a,
b,
c = 99;
const i;
const i = 0;
const a,
b,
c = 99;
String literal
1 module2 kind es63 $4 var fullName = "Baby"5 # Here fullName is a reference to a JsWizzi variable inside a Ittf Macro6 const author = "${fullName}"7 +8 # Here fullName is a javascript variable9 var fullName = "George"10 +11 # The backtick [`] (alt+96) can embed Ittf Macros as normal text12 const author = `${fullName}`13 +14 # You can write also:15 let sentence16 `lit17 + Hello, my name is18 @ fullName
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
// Here fullName is a reference to a JsWizzi variable inside a Ittf Macro
const author = "Baby";
// Here fullName is a javascript variable
var fullName = "George";
// The backtick [`] (alt+96) can embed Ittf Macros as normal text
const author = `${fullName}`;
// You can write also:
let sentence = `Hello, my name is${fullName}`;
String literal 2
1 let sentence2 set "Hello, my name is " + fullName + ".\n\n" + "I'll be " + (age + 1) + " years old next month."
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
let sentence = "Hello, my name is " + fullName + ".\n\n" + "I'll be " + (age + 1) + " years old next month.";
Array 1
1 let list2 [3 @ 14 @ 25 @ 3
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
let list = [
1,
2,
3
];
Line and multiline comments
1 module2 kind es63 +4 # this is a line comment5 +6 #7 # this is a multiline comment8 +9 ## this is a multiline comment10 +11 ##12 # this is a13 # multiline comment14 +
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
// this is a line comment
/**
this is a multiline comment
*/
/**
this is a multiline comment
*/
/**
this is a
multiline comment
*/
Commenting functions
1 module2 kind es63 #4 # function alpha5 function alpha6 # var i7 var i8 # var j9 var j
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
/**
function alpha
*/
function alpha() {
// var i
var i;
// var j
var j;
}
Commenting classes
1 module2 kind es63 #4 # function alpha5 function alpha6 # var i7 var i8 # var j9 var j
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
/**
function alpha
*/
function alpha() {
// var i
var i;
// var j
var j;
}
array concat single line statement
1 const myArrayNew2 concat myArray 0, 1, 2, [3, 4]
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
const myArrayNew = myArray.concat(0, 1, 2, [3, 4]);
;
array concat multi line statement
1 const myArrayNew2 concat myarray3 @ 04 @ 15 @ 26 [7 @ 38 @ 4
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
const myArrayNew = myarray.concat(0, 1, 2, [
3,
4
]);
;
array concat mixed line statement
1 const myArrayNew2 concat myarray 0, 13 @ 24 [5 @ 36 @ 4
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
const myArrayNew = myarray.concat(0, 1, 2, [
3,
4
]);
;
array forEach statement with default thisArg
1 each item in myarray2 set item.a = item.b / 2
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.forEach(function(item, item_index, array) {
item.a = item.b / 2;
}, this);
array forEach statement with explicit thisArg
1 each item in myarray myinstance2 set item.a = item.b / 2
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.forEach(function(item, item_index, array) {
item.a = item.b / 2;
}, myinstance);
array filter statement with default thisArg
1 filter item in myarray2 return item.a == 10
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.filter(function(item, item_index, array) {
return item.a == 10;
}, this);
array filter statement with explicit thisArg
1 filter item in myarray myinstance2 return item.a == this.maxAge
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.filter(function(item, item_index, array) {
return item.a == this.maxAge;
}, myinstance);
array find statement with default thisArg
1 find item in myarray2 return item.a == 10
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.find(function(item, item_index, array) {
return item.a == 10;
}, this);
array find statement with explicit thisArg
1 find item in myarray myinstance2 return item.a == this.maxAge
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.find(function(item, item_index, array) {
return item.a == this.maxAge;
}, myinstance);
array reduce statement
1 reduce item in myarray 02 return acc + item.a
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
myarray.reduce( (acc, item, item_index, array) => {
return acc + item.a;
}, 0);
object definition
1 const myObj2 {3 @ name "duby"4 [ jobs5 @ "Programmer"6 @ "Auditor"7 @ "Consultant"8 { adress9 @ street "Via Nazionale, 10"10 @ city "Reggio Emilia"11 @ country "Italy"
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
const myObj = {
name: "duby",
jobs: [
"Programmer",
"Auditor",
"Consultant"
],
adress: {
street: "Via Nazionale, 10",
city: "Reggio Emilia",
country: "Italy"
}
};
Function with no params
1 function sayHello2 log 'Hello'
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
function sayHello() {
console.log('Hello', __filename);
}
Function with unchecked params
1 function sayHello2 param name3 log 'Hello ' + name
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
function sayHello(name) {
console.log('Hello ' + name, __filename);
}
Function with checked params
1 function sayHello2 string name3 log 'Hello ' + name
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var verify = require('@wizzi/utils').verify;
function sayHello(name) {
if (verify.isNotEmpty(name) === false) {
return error(
'InvalidArgument', 'sayHello', { parameter: 'name', message: 'The name parameter must be a string. Received: ' + name }
);
}
console.log('Hello ' + name, __filename);
}
/**
params
string code
# the error name or number
string method
string message
# optional
{ innerError
# optional
*/
function error(code, method, message, innerError) {
var parameter = null;
if (verify.isObject(message)) {
parameter = message.parameter;
message = message.message;
}
return verify.error(innerError, {
name: ( verify.isNumber(code) ? 'Err-' + code : code ),
method: '.' + method,
parameter: parameter,
sourcePath: __filename
}, message || 'Error message unavailable');
}
Function with checked params and callback
1 function sayHello2 string name3 callback4 log 'Hello ' + name
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var verify = require('@wizzi/utils').verify;
function sayHello(name, callback) {
if (typeof(callback) !== 'function') {
throw new Error(
error('InvalidArgument', 'sayHello', 'The callback parameter must be a function. Received: ' + callback)
);
};
if (verify.isNotEmpty(name) === false) {
return callback(error(
'InvalidArgument', 'sayHello', { parameter: 'name', message: 'The name parameter must be a string. Received: ' + name }
));
}
console.log('Hello ' + name, __filename);
}
/**
params
string code
# the error name or number
string method
string message
# optional
{ innerError
# optional
*/
function error(code, method, message, innerError) {
var parameter = null;
if (verify.isObject(message)) {
parameter = message.parameter;
message = message.message;
}
return verify.error(innerError, {
name: ( verify.isNumber(code) ? 'Err-' + code : code ),
method: '.' + method,
parameter: parameter,
sourcePath: __filename
}, message || 'Error message unavailable');
}
Function with checked params and callback
1 function sayHello2 string name3 any greetings4 callback5 log 'Hello ' + name
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var verify = require('@wizzi/utils').verify;
function sayHello(name, greetings, callback) {
if (typeof(callback) !== 'function') {
throw new Error(
error('InvalidArgument', 'sayHello', 'The callback parameter must be a function. Received: ' + callback)
);
};
if (verify.isNotEmpty(name) === false) {
return callback(error(
'InvalidArgument', 'sayHello', { parameter: 'name', message: 'The name parameter must be a string. Received: ' + name }
));
}
console.log('Hello ' + name, __filename);
}
/**
params
string code
# the error name or number
string method
string message
# optional
{ innerError
# optional
*/
function error(code, method, message, innerError) {
var parameter = null;
if (verify.isObject(message)) {
parameter = message.parameter;
message = message.message;
}
return verify.error(innerError, {
name: ( verify.isNumber(code) ? 'Err-' + code : code ),
method: '.' + method,
parameter: parameter,
sourcePath: __filename
}, message || 'Error message unavailable');
}
Arrow function
1 module2 kind es63 var handler4 =>5 param event6 set value = event.target.value
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var handler = event =>
value = event.target.value
;
Async arrow function
1 module2 kind es63 var handler4 async=>5 param event6 const obj7 await8 _ getObject9 @ event.target.value
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var handler;
async (event) => {
const obj = await getObject(event.target.value);
}
Generator function
1 module2 kind es63 # reference https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Operators/yield4 function* foo5 var index = 06 while index <= 27 yield index++
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
// reference https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Operators/yield
function* foo() {
var index = 0;
while (index <= 2) {
yield index++;
}
}
Async function, await statement
1 module2 kind es63 async-function foo4 var index5 await6 _ myPromiseFunc
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
async function foo() {
var index;
await myPromiseFunc();
}
IIFE function
1 module2 kind es63 iife4 unary-prefix ;5 param x6 param y7 return alpha = x + ': ' + y8 ()9 @ key10 @ id
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
;(function(x, y) {
return alpha = x + ': ' + y;
})(key, id)
;
Call with no parameters
1 _ execute
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
execute();
Call with string and number parameters
1 _ display2 @ 'name'3 @ 3
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
display('name', 3)
Call with string and call parameters
1 _ showUserName2 @ userId3 _ getName4 @ userId
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
showUserName(userId, getName(userId))
Call with string and object parameters
1 _ showUserProfile2 @ userId3 {4 @ showEmail5 _ isEmailVisible6 @ userId7 [ sections8 @ 'about-me'9 @ 'projects'
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
showUserProfile(userId, {
showEmail: isEmailVisible(userId),
sections: [
'about-me',
'projects'
]
})
If, else if, else ...
1 module2 kind es63 if a == 14 _ a5 elif a == 26 _ b7 else8 _ c
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
if (a == 1) {
a();
}
else if (a == 2) {
b();
}
else {
c();
}
Switch, case, default ...
1 module2 kind es63 +4 switch a5 case 16 _ a7 case 28 _ b9 default10 _ c11 +12 switch13 _ getA14 case 115 _ a16 case 217 _ b18 default19 _ c
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
switch (a) {
case 1: {
a();
}
case 2: {
b();
}
default: {
c();
}
}
switch (getA()) {
case 1: {
a();
}
case 2: {
b();
}
default: {
c();
}
}
foreach loop
1 foreach item in myarray2 set item.a = item.b / 2
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var i, i_items=myarray, i_len=myarray.length, item;
for (i=0; i<i_len; i++) {
item = myarray[i];
item.a = item.b / 2;
}
for loop
1 for var k in myObj2 log myObj[k]
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
for (var k in myObj) {
console.log(myObj[k], __filename);
}
while loop
1 while item.parent2 set item = item.parent
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
while (item.parent) {
item = item.parent;
}
do while loop
1 do item.parent2 set item = item.parent
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
do {
item = item.parent;
} while (item.parent)
Simple class
1 module2 kind es63 class Greeter4 p greeting5 ctor6 param message7 set this.greeting = message8 m greet9 return "Hello, " + this.greeting10 let greeter = new Greeter("world")
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Greeter {
constructor(message) {
this.greeting = message;
}
greeting;
greet() {
return "Hello, " + this.greeting;
}
}
let greeter = new Greeter("world");
Class extension
1 module2 kind es63 class Animal4 m move5 param distanceInMeters6 _ console.log7 `lit8 + Animal moved ${}9 @ distanceInMeters10 + m.11 class Dog12 super Animal13 m bark14 _ console.log('Woof! Woof!')
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Animal {
move(distanceInMeters) {
console.log(`Animal moved ${distanceInMeters}m.`)
}
}
class Dog extends Animal {
bark() {
console.log('Woof! Woof!');
}
}
Complex class example
1 module2 kind es63 class Animal4 p name5 ctor6 param theName7 set this.name = theName8 m move9 param distanceInMeters10 _ console.log11 `lit12 +13 @ this.name14 + ${} moved ${}15 @ distanceInMeters16 + m.17 class Snake18 super Animal19 ctor20 param name21 _ super(name)22 m move23 param distanceInMeters = 524 _ console.log("Slithering...")25 _ super.move(distanceInMeters)26 class Horse27 super Animal28 ctor29 param name30 _ super(name)31 m move32 param distanceInMeters = 4533 _ console.log("Galloping...")34 _ super.move(distanceInMeters)
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Animal {
constructor(theName) {
this.name = theName;
}
name;
move(distanceInMeters) {
console.log(`${this.name} moved ${distanceInMeters}m.`)
}
}
class Snake extends Animal {
constructor(name) {
super();
super(name);
}
move(distanceInMeters = 5) {
console.log("Slithering...");
super.move(distanceInMeters);
}
}
class Horse extends Animal {
constructor(name) {
super();
super(name);
}
move(distanceInMeters = 45) {
console.log("Galloping...");
super.move(distanceInMeters);
}
}
Class accessors
1 module2 kind es63 class Animal4 p name5 ctor6 param theName7 set this.name = theName8 class Rhino9 super Animal10 ctor11 _ super("Rhino")12 class Employee13 p name14 ctor15 param theName16 set this.name = theName17 let animal = new Animal("Goat")18 let rhino = new Rhino()19 let employee = new Employee("Bob")20 set animal = rhino21 set animal = employee
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Animal {
constructor(theName) {
this.name = theName;
}
name;
}
class Rhino extends Animal {
constructor() {
super();
super("Rhino");
}
}
class Employee {
constructor(theName) {
this.name = theName;
}
name;
}
let animal = new Animal("Goat");
let rhino = new Rhino();
let employee = new Employee("Bob");
animal = rhino;
animal = employee;
Class accessors
1 module2 kind es63 class Person4 p name5 ctor6 param name7 set this.name = name8 class Employee9 super Person10 p department11 ctor12 param name13 param department14 _ super(name)15 set this.department = department16 m getElevatorPitch17 return18 `lit19 + Hello, my name is ${}20 @ this.name21 + ${} and I work in ${}22 @ this.department23 + .
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Person {
constructor(name) {
this.name = name;
}
name;
}
class Employee extends Person {
constructor(name, department) {
super();
super(name);
this.department = department;
}
department;
getElevatorPitch() {
return `Hello, my name is ${this.name} and I work in ${this.department}.`;
}
}
Static members
1 class Grid2 p origin3 static4 @ x 05 @ y 06 ctor7 param scale8 m calculateDistanceFromOrigin9 param point10 let xDist = (point.x - Grid.origin.x)11 let yDist = (point.y - Grid.origin.y)12 return Math.sqrt(xDist * xDist + yDist * yDist) / this.scale
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Grid {
constructor(scale) {
}
static origin = {
x: 0,
y: 0
}
calculateDistanceFromOrigin(point) {
let xDist = (point.x - Grid.origin.x);
let yDist = (point.y - Grid.origin.y);
return Math.sqrt(xDist * xDist + yDist * yDist) / this.scale;
}
}
Static members
1 +2 class Greeter3 p standardGreeting = "Hello, there"4 static5 p greeting6 m greet7 if this.greeting8 return "Hello, " + this.greeting9 else10 return Greeter.standardGreeting
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class Greeter {
static standardGreeting = "Hello, there";
greeting;
greet() {
if (this.greeting) {
return "Hello, " + this.greeting;
}
else {
return Greeter.standardGreeting;
}
}
}
Console log
1 module2 kind es63 log 'Hello', 334 info 'Hello', 335 success 'Hello', 336 warn 'Hello', 337 error 'Hello', 33
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
console.log('Hello', 33, __filename);
console.log('Hello', 33);
console.log("[32m%s[0m", 'Hello', 33);
console.log("[33m%s[0m", 'Hello', 33);
console.log("[31m%s[0m", 'Hello', 33);
...
1 meta2 schema js3 language javascript4 element variables5 tag var|const|let6 ast7 category8 item9 title Variable declaration10 ittf11 module12 kind es613 var i14 var i = 015 var16 decl a17 decl b18 decl c = 9919 let i20 let i = 021 let22 decl a23 decl b24 decl c = 9925 const i26 const i = 027 const28 decl a29 decl b30 decl c = 9931 item32 title String literal33 ittf34 module35 kind es636 $37 var fullName = "Baby"38 # Here fullName is a reference to a JsWizzi variable inside a Ittf Macro39 const author = "${fullName}"40 +41 # Here fullName is a javascript variable42 var fullName = "George"43 +44 # The backtick [`] (alt+96) can embed Ittf Macros as normal text45 const author = `${fullName}`46 +47 # You can write also:48 let sentence49 `lit50 + Hello, my name is51 @ fullName52 item53 title String literal 254 ittf55 let sentence56 set "Hello, my name is " + fullName + ".\n\n" + "I'll be " + (age + 1) + " years old next month."57 item58 title Array 159 ittf60 let list61 [62 @ 163 @ 264 @ 365 element comments66 tag #|##67 ast68 category69 item70 title Line and multiline comments71 ittf72 module73 kind es674 +75 # this is a line comment76 +77 #78 # this is a multiline comment79 +80 ## this is a multiline comment81 +82 ##83 # this is a84 # multiline comment85 +86 item87 title Commenting functions88 ittf89 module90 kind es691 #92 # function alpha93 function alpha94 # var i95 var i96 # var j97 var j98 item99 title Commenting classes100 ittf101 module102 kind es6103 #104 # function alpha105 function alpha106 # var i107 var i108 # var j109 var j110 element array111 tag _112 ast113 category arrays114 item115 title array concat single line statement116 ittf117 const myArrayNew118 concat myArray 0, 1, 2, [3, 4]119 item120 title array concat multi line statement121 ittf122 const myArrayNew123 concat myarray124 @ 0125 @ 1126 @ 2127 [128 @ 3129 @ 4130 item131 title array concat mixed line statement132 ittf133 const myArrayNew134 concat myarray 0, 1135 @ 2136 [137 @ 3138 @ 4139 item140 title array forEach statement with default thisArg141 ittf142 each item in myarray143 set item.a = item.b / 2144 item145 title array forEach statement with explicit thisArg146 ittf147 each item in myarray myinstance148 set item.a = item.b / 2149 item150 title array filter statement with default thisArg151 ittf152 filter item in myarray153 return item.a == 10154 item155 title array filter statement with explicit thisArg156 ittf157 filter item in myarray myinstance158 return item.a == this.maxAge159 item160 title array find statement with default thisArg161 ittf162 find item in myarray163 return item.a == 10164 item165 title array find statement with explicit thisArg166 ittf167 find item in myarray myinstance168 return item.a == this.maxAge169 item170 title array reduce statement171 ittf172 reduce item in myarray 0173 return acc + item.a174 element objects175 tag {176 ast177 category objects178 item179 title object definition180 ittf181 const myObj182 {183 @ name "duby"184 [ jobs185 @ "Programmer"186 @ "Auditor"187 @ "Consultant"188 { adress189 @ street "Via Nazionale, 10"190 @ city "Reggio Emilia"191 @ country "Italy"192 element function193 tag function, =>, m194 ast FunctionDeclaration, FunctionExpression195 category function-statements196 item197 title Function with no params198 ittf199 function sayHello200 log 'Hello'201 item202 title Function with unchecked params203 ittf204 function sayHello205 param name206 log 'Hello ' + name207 item208 title Function with checked params209 ittf210 function sayHello211 string name212 log 'Hello ' + name213 item214 title Function with checked params and callback215 ittf216 function sayHello217 string name218 callback219 log 'Hello ' + name220 item221 title Function with checked params and callback222 ittf223 function sayHello224 string name225 any greetings226 callback227 log 'Hello ' + name228 item229 title Arrow function230 ittf231 module232 kind es6233 var handler234 =>235 param event236 set value = event.target.value237 item238 title Async arrow function239 ittf240 module241 kind es6242 var handler243 async=>244 param event245 const obj246 await247 _ getObject248 @ event.target.value249 item250 title Generator function251 ittf252 module253 kind es6254 # reference https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Operators/yield255 function* foo256 var index = 0257 while index <= 2258 yield index++259 item260 title Async function, await statement261 ittf262 module263 kind es6264 async-function foo265 var index266 await267 _ myPromiseFunc268 item269 title IIFE function270 ittf271 module272 kind es6273 iife274 unary-prefix ;275 param x276 param y277 return alpha = x + ': ' + y278 ()279 @ key280 @ id281 element call282 tag _283 ast CallExpression284 category call-statements285 item286 title Call with no parameters287 ittf288 _ execute289 item290 title Call with string and number parameters291 ittf292 _ display293 @ 'name'294 @ 3295 item296 title Call with string and call parameters297 ittf298 _ showUserName299 @ userId300 _ getName301 @ userId302 item303 title Call with string and object parameters304 ittf305 _ showUserProfile306 @ userId307 {308 @ showEmail309 _ isEmailVisible310 @ userId311 [ sections312 @ 'about-me'313 @ 'projects'314 element conditionals315 tag if|elif|else|switch|case|default316 ast317 category318 item319 title If, else if, else ...320 ittf321 module322 kind es6323 if a == 1324 _ a325 elif a == 2326 _ b327 else328 _ c329 item330 title Switch, case, default ...331 ittf332 module333 kind es6334 +335 switch a336 case 1337 _ a338 case 2339 _ b340 default341 _ c342 +343 switch344 _ getA345 case 1346 _ a347 case 2348 _ b349 default350 _ c351 element loops352 tag _353 ast354 category arrays355 item356 title foreach loop357 ittf358 foreach item in myarray359 set item.a = item.b / 2360 item361 title for loop362 ittf363 for var k in myObj364 log myObj[k]365 item366 title while loop367 ittf368 while item.parent369 set item = item.parent370 item371 title do while loop372 ittf373 do item.parent374 set item = item.parent375 element class376 tag class377 ast378 category379 item380 title Simple class381 ittf382 module383 kind es6384 class Greeter385 p greeting386 ctor387 param message388 set this.greeting = message389 m greet390 return "Hello, " + this.greeting391 let greeter = new Greeter("world")392 item393 title Class extension394 ittf395 module396 kind es6397 class Animal398 m move399 param distanceInMeters400 _ console.log401 `lit402 + Animal moved ${}403 @ distanceInMeters404 + m.405 class Dog406 super Animal407 m bark408 _ console.log('Woof! Woof!')409 item410 title Complex class example411 ittf412 module413 kind es6414 class Animal415 p name416 ctor417 param theName418 set this.name = theName419 m move420 param distanceInMeters421 _ console.log422 `lit423 +424 @ this.name425 + ${} moved ${}426 @ distanceInMeters427 + m.428 class Snake429 super Animal430 ctor431 param name432 _ super(name)433 m move434 param distanceInMeters = 5435 _ console.log("Slithering...")436 _ super.move(distanceInMeters)437 class Horse438 super Animal439 ctor440 param name441 _ super(name)442 m move443 param distanceInMeters = 45444 _ console.log("Galloping...")445 _ super.move(distanceInMeters)446 item447 title Class accessors448 ittf449 module450 kind es6451 class Animal452 p name453 ctor454 param theName455 set this.name = theName456 class Rhino457 super Animal458 ctor459 _ super("Rhino")460 class Employee461 p name462 ctor463 param theName464 set this.name = theName465 let animal = new Animal("Goat")466 let rhino = new Rhino()467 let employee = new Employee("Bob")468 set animal = rhino469 set animal = employee470 item471 title Class accessors472 ittf473 module474 kind es6475 class Person476 p name477 ctor478 param name479 set this.name = name480 class Employee481 super Person482 p department483 ctor484 param name485 param department486 _ super(name)487 set this.department = department488 m getElevatorPitch489 return490 `lit491 + Hello, my name is ${}492 @ this.name493 + ${} and I work in ${}494 @ this.department495 + .496 item497 title Static members498 ittf499 class Grid500 p origin501 static502 @ x 0503 @ y 0504 ctor505 param scale506 m calculateDistanceFromOrigin507 param point508 let xDist = (point.x - Grid.origin.x)509 let yDist = (point.y - Grid.origin.y)510 return Math.sqrt(xDist * xDist + yDist * yDist) / this.scale511 item512 title Static members513 ittf514 +515 class Greeter516 p standardGreeting = "Hello, there"517 static518 p greeting519 m greet520 if this.greeting521 return "Hello, " + this.greeting522 else523 return Greeter.standardGreeting524 element logger525 tag log|info|success|error|warn526 ast527 category logger528 item529 title Console log530 ittf531 module532 kind es6533 log 'Hello', 33534 info 'Hello', 33535 success 'Hello', 33536 warn 'Hello', 33537 error 'Hello', 33538 element debug539 tag540 ast541 category debug542 item543 title ...544 ittf545 element react546 tag _547 ast548 category react549 item550 title class551 ittf552 react MyComponent553 render554 return555 h1 Hello world556 item557 title var558 ittf559 var Hello560 div561 p sicut amet nequi abisse562 item563 title var svg564 ittf565 var Hello566 div567 svg568 rect569 stroke-dashoffset 10
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class
1 react MyComponent2 render3 return4 h1 Hello world
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
class MyComponent extends React.Component {
render() {
return (
<h1>Hello world</h1>
)
;
}
}
var
1 var Hello2 div3 p sicut amet nequi abisse
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var Hello = (
<div>
<p>sicut amet nequi abisse</p>
</div>
)
;
var svg
1 var Hello2 div3 svg4 rect5 stroke-dashoffset 10
/*
artifact generator: /app/node_modules/@wizzi/plugin.js/lib/artifacts/js/module/gen/main.js
package: @wizzi/[email protected]
primary source IttfDocument: json:/index.js.ittf
utc time: Tue, 06 May 2025 03:58:34 GMT
*/
var Hello = (
<div>
<svg>
<rect strokeDashoffset="10">
</rect>
</svg>
</div>
)
;