i like to convert a type given by a string, because i want to convert a string of numbers to an array of numbers.
var myStringType = "number[]";
var myString = "0, 0, 0";
var myStringArray = myString.Split(","); <- these array need to be a array;
var myNumbersArray = ConvertToAnyByString(myStringArray, myStringType);
I can convert by knowing the type, if the method above is not possible. Is there something like compare against typeof(number[])
Update: I think here is a misunderstanding. I don't know which type will passed to my function. I need type check that or convert it by a string information which type it is. And there is no way to do that natively in javascript, because there is no type of arrayOfStrings there is just a array. But i can make a helper functions to do this by hand.
'0,0,0'.split(',')that'll actually give you an array["0", "0", "0"].