Do variables need a data type?

Q

Do variables need a data type?

A

If an assignment do create a variable, the variable gets implicitly the data type based on the value that has been assigned. It is also possible that avariable is changing its data type with the next assignment.

Example code:

mystring = “Hello“ -- is of type string
mynumber = 5 -- is of type number
dynvar = 5 -- is of type number now
dynvar = “Hello“ -- is of type string now