typeof(myVar) == "string"
@VirtualVirgin said in Quick coding question: Is there a way to check if a variable is a string?:
I would like to make an inline function that can accept either an integer or a string as one of the arguments,
I would try to avoid this. I've started using the type safety stuff in HISE for everything lately and it prevents lots of little type related bugs I used to run into, before they can happen. But to use it you need to allow only one data type possibility per parameter/return value.
If you want to have one or the other I would create two functions, or turn your strings into numbers with parseInt/parseFloat.