ts [].find.call 这种写法怎么用?-灵析社区

东三环

const topAncestorElement = [].find.call(document.querySelectorAll('[draggable-group-name]'), (e: HTMLElement) => e.contains(dom)) `topAncestorElement` 的类型是 `call` 的返回值 `undefined`; 我希望使用 `[].find.call` 这种写法,要怎么修改呢? * * * ` as unknown as HTMLElement` 这样断言就行了。之前没注意看提示...

阅读量:214

点赞量:14

问AI
你好我叫张倩话
"as unknown as HTMLElement"