There's a special name for it, but I can't remember what it is. There are two different terms, one for casting an array of a subclass to an array of its superclass, and the other way around.
To convert a JavaScript array into a string, you can use the built-in Array method called toString . Keep in mind that the toString method can't be used on an array of objects because it will return [object Object] instead of the actual values.
As list. toArray() returns an Object[], it can be converted to String array by passing the String[] as parameter.
The implode() function returns a string from the elements of an array. Note: The implode() function accept its parameters in either order.
object can be anything uint[], int16[], etc. string[] str = Array. ConvertAll<object, string>((object[])obj, Convert. ToString);
Array Upcasting and Array Downcasting.
EDIT: Covariance and Contravariance is ability to treat certain types as same or not the same depending on composition and inheritance semantics. This has nothing to do with casting arrays, which just happen to be one case where co-variance comes into play.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With