Variables and Data Types
Declaring Variables
There are only three data types in Confuscript: String, Number, and Boolean
Before we dive into these data types let’s understand how we declare variables in Confuscript.
In traditional JavaScript, we would use var or let or const to declare variables.
var x = 10;
let y = 20;
const z = 30;
// And if we were to set a null variable
var a = null;
In Confuscript, null is the keyword used to declare variables
null x;
The above code will declare a variable x with a value of null or nil since it’s built on Ruby.
String
Strings are declared using null keyword followed by the variable name and the value in quotes.
null x = "Hello World!";
Number
Numbers are declared using null keyword followed by the variable name and the value.
null x = 10;
Boolean
Boolean values are declared using null keyword followed by the variable name and the value.
null x = true;