How do you get the type of a variable in Ballerina?
I know that boolean checks are possible such as these below:
import ballerina/io;
public function main() {
any x = "This is a test";
io:println(x is string); // Evaluates to true
io:println(x is float); // Evaluates to false
}
In Python, we use type(variable)
and get the type, in Java it is as follows:
String a = "test";
a.getClass().getName()
How do we do this in Ballerina? I've tried to look in the docs and the closest I can find is lang.typedesc
.