// when blog is done https://cookeylangblog.cookeylangteam.repl.co

type conversion

Variable conversion will convert one variable to another.

var variable = "5";
printLine(@"number":variable); %% 5

var variable = "d";
printLine(@"number":variable); %% Error cannot convert to number

Now variable is of type number and is now able to add with other numbers.
If it can't be converted, it will throw error.

The syntax is,

@[type (string)]:[unary]

and the types are,

NaV

The NaV type is used to convert undefined variables to NaV. Defined variables/expressions are unaffected.

@"NaV":undefvariable; %% NaV
@"NaV":5; %% 5