// let arr_name, elemType[];
let list: number[] = [1, 2, 3];
// Generic array type, Array<elemType>:
let list: Array<number> = [1, 2, 3];
if (Array.isArray(value)) {
var somethingIsNotString = false;
value.forEach(function(item){
if(typeof item !== 'string'){
somethingIsNotString = true;
}
})
if(!somethingIsNotString && value.length > 0){
console.log('string[]!');
}
}
const animals = ['cat', 'dog', 'mouse'] as const
type Animal = typeof animals[number]
// type Animal = 'cat' | 'dog' | 'mouse'
let list: number[] = [1, 2, 3];