How to recognize the type of a variable?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tort
:warning: Old Version Published before Godot 3 was released.

Suppose a variable can be of two types
var test_var = Transform() or var test_var = get_node('node')
How to recognize the type of a variable?
Those. If the test_var is transformation, then return ‘this transformation’, and if the test_var is node, then return ‘this node’.

:bust_in_silhouette: Reply From: kidscancode

You can use typeof() to find the type of a variable: