小编Chr*_*s C的帖子

73:36 - 错误 TS2339:类型“any[]”上不存在属性“fill”

首先让我开始,我是 TypeScript 的新手,我的眼睛不习惯错误类型和/或编译问题

这是我的第 73 行

this.ranks = new Array(13).fill(0).map(function (_) { return []; });

这是我的tsconfig

{
  "compilerOptions": {
    /* Basic Options */
    "target": "ES2015",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
    "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
    "lib": ["es2015", "DOM"],                             /* Specify library files to be included in the compilation. */
    // "allowJs": true,                       /* Allow javascript files to be compiled. …
Run Code Online (Sandbox Code Playgroud)

typescript

5
推荐指数
1
解决办法
3198
查看次数

标签 统计

typescript ×1