Typ kann nicht verwendet werden, als ein index-Typ

Gehen https://www.typescriptlang.org/play/index.html und einfügen:

let userTypes = {};
let keys = Object.keys[userTypes];

Fehlermeldung:

error TS2538: Type '{}' cannot be used as an index type.

Warum?

InformationsquelleAutor Eu Insumi Prunc | 2016-12-30

Schreibe einen Kommentar