Skip to content

Changing 'lib' compiler option doesn't make a sense for Object.fromEntries #2030

@Eugeno

Description

@Eugeno

Property 'fromEntries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later.

component:

obj = Object.fromEntries(this.arr.map((ar) => [ar.a, ar.b]));

tsconfig.json:

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es2019",
    "lib": [
      "es2020",
      "dom"
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions