Is it logical to use this type of typeguard check in a function like the following:
Foo(value: any[]) {
if (value instanceof Array) {
Console.log('having an
array')
}
}
Given that the parameter is defined as an array of any, does this automatically mean that the runtime value will always be an instance of an array?
Is this a unique scenario where using 'any' requires a typeguard?
What I'm trying to ask is: does specifying the type of a parameter guarantee that the runtime value of that parameter will display as that specific type in developer tools? In this situation, checking for an instance of that type may seem unnecessary..