score:0

let starsArray: JSX.Element[] = [];

const [array, setArray] = useState<JSX.Element[]>([]);

score:1

interface ISomething {
    arr: string[]
}

// Somewhere in a class a method uses ISomething interface.
public someMethod(): ISomething['arr'] {
    // Note, if you omit ": ISomething['arr']" in the line below
    // you would face ts2345 error when you push a string into the array later.
    const localArray: ISomething['arr'] = [];
    localArray.push('somestring');
    return localArray;
}


Related Query

More Query from same tag