Answers for "typescript return type of array type function"

0

typescript function return array

function retarray():string[] { 
   return new Array("Apple","Grappe","Banana");
} 
 
var fruits:string[] = retarray();
Posted by: Guest on April-24-2021
0

typescript type from array

const animals = ['cat', 'dog', 'mouse'] as const
type Animal = typeof animals[number]

// type Animal = 'cat' | 'dog' | 'mouse'
Posted by: Guest on May-01-2021

Code answers related to "typescript return type of array type function"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language