In ActionScript, Is there a way to check if an input argument is a valid Vector of any type?
- by ty
In the following code:
var a:Vector.<int> ...
var b:Vector.<String> ...
var c:Vector.<uint> ...
var c:Vector.<MyOwnClass> ...
function verifyArrayLike(arr:*):Boolean
{
return (arr is Array || arr is Vector)
}
verifyArrayLike(a);
verifyArrayLike(b);
...
What I'm looking for is something like _var is Vector.<*>
But Vector.<*> is not a valid expression, even Vector. can not be placed at the right side of operators.
Is there a way to check if an input argument is a valid Vector of any type?