如何对只读数组(ReadonlyArray)进行数组检查(如Array.isArray())?Array.isArray(readonlyArrayTest)) { // but the TypeScriptcompiler thinks it's following:
// let readonlyArrayTest: string |
如果存在一个值,我正在试图反演对象的字段,但是我得到了一些我无法解密的错误。index signature with a parameter of type 'string' was found on type 'Control'.ts(7053)
但是,如果我显式地传递对象的一个字段(如control['name1'] ),错误就会消失。有什么我不明白的吗?